From 6e0c3212df13473d0d781aabea1844089f87754d Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Fri, 6 Jul 2018 16:15:35 +0200 Subject: [PATCH 01/19] Route example: Added a 2s sleep to the Monitor after an add transition to avoid removing right away --- .../src/main/java/org/javabip/spec/RouteOnOffMonitor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java index 8c1f7c5f..6e46a6e4 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java @@ -36,12 +36,19 @@ public RouteOnOffMonitor(int routeLimit) { @Transitions({ @Transition(name = "add", source = "0", target = "1", guard = "hasCapacity"), @Transition(name = "add", source = "1", target = "2", guard = "hasCapacity") }) public void addRoute() { + routeOnCounter++; + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } } @Transitions({ @Transition(name = "rm", source = "2", target = "1", guard = "hasRouteRunning"), @Transition(name = "rm", source = "1", target = "0", guard = "hasRouteRunning") }) public void removeRoute() { + routeOnCounter--; } From 66be3c599450337c0b15b5292343e75bfeee15e0 Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Sat, 7 Jul 2018 14:16:00 +0200 Subject: [PATCH 02/19] Added the possibility to ask the executor about the current state of the component --- org.javabip.api/src/main/java/org/javabip/api/BIPActor.java | 5 +++++ .../src/main/java/org/javabip/executor/ExecutorKernel.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/org.javabip.api/src/main/java/org/javabip/api/BIPActor.java b/org.javabip.api/src/main/java/org/javabip/api/BIPActor.java index ab8fc443..a97e66d4 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/BIPActor.java +++ b/org.javabip.api/src/main/java/org/javabip/api/BIPActor.java @@ -44,4 +44,9 @@ public interface BIPActor { */ void inform(String portID, Map data); + /** + * It returns the control state of the BIP component that Executor runs. + */ + String getState (); + } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java index 04178646..5dc3294e 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java @@ -407,4 +407,9 @@ public BIPEngine engine() { return engine; } + @Override + public String getState() { + return behaviour.getCurrentState(); + } + } From 027b0d8a3280dab5ff4885f730a2c4717bd86059 Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Sat, 7 Jul 2018 14:29:51 +0200 Subject: [PATCH 03/19] Modified SwitchableRoutes to output some logging information on stdout (did not manage to get the logger working) Also added a 2 sec wait after starting to ensure the route has time to pick-up some work (not sure this actually contributes) --- .../org/javabip/spec/SwitchableRoute.java | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java index e1479a85..75e78485 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java @@ -30,11 +30,7 @@ import org.apache.camel.model.ModelCamelContext; import org.apache.camel.model.RouteDefinition; import org.apache.camel.spi.RoutePolicy; -import org.javabip.annotations.ComponentType; -import org.javabip.annotations.Guard; -import org.javabip.annotations.Port; -import org.javabip.annotations.Ports; -import org.javabip.annotations.Transition; +import org.javabip.annotations.*; import org.javabip.api.Executor; import org.javabip.api.PortType; import org.slf4j.Logger; @@ -42,8 +38,12 @@ import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; -@Ports({ @Port(name = "end", type = PortType.spontaneous), @Port(name = "on", type = PortType.enforceable), - @Port(name = "off", type = PortType.enforceable), @Port(name = "finished", type = PortType.enforceable) }) +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) @ComponentType(initial = "off", name = "org.bip.spec.SwitchableRoute") public class SwitchableRoute implements CamelContextAware, InitializingBean, DisposableBean { @@ -78,45 +78,48 @@ public SwitchableRoute(String routeId, CamelContext camelContext) { this.camelContext = (ModelCamelContext) camelContext; } - /** - * In some cases you may want to execute - */ - // @Port(name="end", type="spontaneous") - public void workDone() { - logger.debug("Port handler for end port is executing."); - } - /* - * Check what are the conditions for throwing the exception. + * TODO: Check what are the conditions for throwing the exception. */ @Transition(name = "off", source = "on", target = "wait", guard = "") public void stopRoute() throws Exception { - logger.debug("Stop transition handler for {} is being executed.", routeId); +// logger.debug("Stop transition handler for {} is being executed.", routeId); + System.out.printf("Stop transition handler for %s is being executed.%n", routeId); camelContext.suspendRoute(routeId); noOfEnforcedTransitions++; } @Transition(name = "end", source = "wait", target = "done", guard = "!isFinished") public void spontaneousEnd() throws Exception { - logger.info("Received end notification for the route {}.", routeId); +// logger.info("Received end notification for the route {}.", routeId); + System.out.printf("Received end notification for the route %s.%n", routeId); } @Transition(name = "", source = "wait", target = "done", guard = "isFinished") public void internalEnd() throws Exception { - logger.info("Transitioning to done state directly since work within {} is already finished.", routeId); +// logger.info("Transitioning to done state directly since work within {} is already finished.", routeId); + System.out.printf("Transitioning to done state directly since work within %s is already finished.%n", routeId); } @Transition(name = "finished", source = "done", target = "off", guard = "") public void finishedTransition() throws Exception { noOfEnforcedTransitions++; - logger.debug("Transitioning to off state from done for {}.", routeId); +// logger.debug("Transitioning to off state from done for {}.", routeId); + System.out.printf("Transitioning to off state from done for %s.%n", routeId); } @Transition(name = "on", source = "off", target = "on", guard = "") public void startRoute() throws Exception { - logger.debug("Start transition handler for {} is being executed.", routeId); +// logger.debug("Start transition handler for {} is being executed.", routeId); + System.out.printf("Start transition handler for %s is being executed.%n", routeId); camelContext.resumeRoute(routeId); noOfEnforcedTransitions++; + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } } @Guard(name = "isFinished") From 761d5679a2f5d9168b326303cb07f0cec038afea Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Sat, 7 Jul 2018 14:31:31 +0200 Subject: [PATCH 04/19] Added a spontaneous port switch to the RouteOnOffMonitor, which switches a Boolean flag. When false, this flag prevents the Monitor from adding new routes (canWork guard) --- .../org/javabip/spec/RouteOnOffMonitor.java | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java index 6e46a6e4..89167d7d 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java @@ -21,20 +21,32 @@ import org.javabip.annotations.*; import org.javabip.api.PortType; -@Ports({ @Port(name = "add", type = PortType.enforceable), @Port(name = "rm", type = PortType.enforceable) }) +@Ports({ + @Port(name = "add", type = PortType.enforceable), + @Port(name = "rm", type = PortType.enforceable), + @Port(name = "switch", type = PortType.spontaneous) +}) @ComponentType(initial = "0", name = "org.bip.spec.RouteOnOffMonitor") public class RouteOnOffMonitor { final private int routeLimit; private int routeOnCounter = 0; + private boolean workAllowed = true; public RouteOnOffMonitor(int routeLimit) { this.routeLimit = routeLimit; } - @Transitions({ @Transition(name = "add", source = "0", target = "1", guard = "hasCapacity"), - @Transition(name = "add", source = "1", target = "2", guard = "hasCapacity") }) + public RouteOnOffMonitor (int routeLimit, boolean workAllowed) { + this.routeLimit = routeLimit; + this.workAllowed = workAllowed; + } + + @Transitions({ + @Transition(name = "add", source = "0", target = "1", guard = "hasCapacity&canWork"), + @Transition(name = "add", source = "1", target = "2", guard = "hasCapacity&canWork") + }) public void addRoute() { routeOnCounter++; @@ -43,13 +55,33 @@ public void addRoute() { } catch (InterruptedException e) { e.printStackTrace(); } + System.out.printf(" routeOnCounter = %d,%n workAllowed = %b%n", routeOnCounter, workAllowed); } - @Transitions({ @Transition(name = "rm", source = "2", target = "1", guard = "hasRouteRunning"), - @Transition(name = "rm", source = "1", target = "0", guard = "hasRouteRunning") }) + @Transitions({ + @Transition(name = "rm", source = "2", target = "1", guard = "hasRouteRunning"), + @Transition(name = "rm", source = "1", target = "0", guard = "hasRouteRunning") + }) public void removeRoute() { routeOnCounter--; + System.out.printf(" routeOnCounter = %d,%n workAllowed = %b%n", routeOnCounter, workAllowed); + } + + @Transitions({ + @Transition(name = "switch", source = "0", target = "0", guard = ""), + @Transition(name = "switch", source = "1", target = "1", guard = ""), + @Transition(name = "switch", source = "2", target = "2", guard = "") + }) + public void switchWorkAllowed() { + + workAllowed = !workAllowed; + System.out.printf("Switch transition handler for Route Monitor is being executed.%n workAllowed = %b%n", workAllowed); + } + + @Guard(name = "canWork") + public boolean canWork() { + return workAllowed; } @Guard(name = "hasCapacity") @@ -62,3 +94,4 @@ public boolean hasRouteRunning() { return routeOnCounter > 0; } } + From fffad85305f8c9fc287f30f0033233f231c57f76 Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Thu, 12 Jul 2018 16:06:38 +0200 Subject: [PATCH 05/19] Added a new glue builder to define synchronisation of several (more than 2) ports Added more monitor examples --- .../org/javabip/executor/ExecutorKernel.java | 2 +- .../java/org/javabip/glue/GlueBuilder.java | 8 +- .../javabip/glue/ManySynchronGlueBuilder.java | 75 ++++++++++++ .../org/javabip/spec/RouteOnOffMonitor.java | 2 +- .../spec/RouteOnOffMonitorWithData.java | 114 ++++++++++++++++++ .../org/javabip/spec/RouteSimpleMonitor.java | 68 +++++++++++ .../java/org/javabip/spec/RouteStarter.java | 49 ++++++++ .../org/javabip/spec/SwitchableRoute.java | 27 +++-- .../org/javabip/spec/SwitchableRoute1.java | 59 +++++++++ .../org/javabip/spec/SwitchableRoute2.java | 47 ++++++++ .../org/javabip/spec/SwitchableRoute3.java | 47 ++++++++ .../org/javabip/spec/SwitchableRoute4.java | 47 ++++++++ .../spec/SwitchableRouteDataTransfers.java | 8 +- 13 files changed, 537 insertions(+), 16 deletions(-) create mode 100644 org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteSimpleMonitor.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteStarter.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute1.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute2.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute3.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute4.java diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java index 5dc3294e..d33e3dd0 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java @@ -258,7 +258,7 @@ else if (!behaviour.existInCurrentStateAndEnabledEnforceableWithoutData(guardToV try { if (!behaviour.checkEnabledness(portID, parameter).get(0)) { - throw new BIPException("Port with " + portID + throw new BIPException("Port " + portID + " that requires data is not enabled for the received data"); } } catch (Exception e) { diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java b/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java index 2501bdfc..60e25f9c 100644 --- a/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java +++ b/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java @@ -122,7 +122,7 @@ public void requiresNothing() { } - private void addRequire(Class spec, String portId, List causes) { + protected void addRequire(Class spec, String portId, List causes) { RequireImpl requires; @@ -144,7 +144,7 @@ private void addRequire(Class spec, String portId, List causes) { } } - private String getComponentType(Class spec) { + protected String getComponentType(Class spec) { Annotation classAnnotation = spec.getAnnotation(ComponentType.class); // get component type @@ -157,7 +157,7 @@ private String getComponentType(Class spec) { } - private void addAccept(Class spec, String portId, Collection causes) { + protected void addAccept(Class spec, String portId, Collection causes) { AcceptImpl accepts; @@ -271,7 +271,7 @@ public void accepts(Object... args) { } - private ArrayList parseCauses(Class currentSpec, Object... args) { + protected ArrayList parseCauses(Class currentSpec, Object... args) { ArrayList result = new ArrayList(); diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java b/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java new file mode 100644 index 00000000..e40c1455 --- /dev/null +++ b/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + */ +package org.javabip.glue; + +import javafx.util.Pair; +import org.javabip.api.PortBase; + +import java.util.ArrayList; +import java.util.stream.Collectors; + +/** + * Glue builder allowing to create synchronous connections between ports. + * + */ +public abstract class ManySynchronGlueBuilder extends GlueBuilder { + + public ManySynchronGlueBuilder() { + super(); + } + + public void synchrons(Object... args) { + + ArrayList, String>> allPorts = new ArrayList, String>>(); + ArrayList allCauses = new ArrayList(); + + Class currentSpec = null; + for (Object o : args) { + + if (o instanceof Class) { + currentSpec = (Class) o; + continue; + } + + if (o instanceof String) { + String effectPortId = (String) o; + allPorts.add(new Pair(currentSpec, effectPortId)); + continue; + } + + throw new IllegalArgumentException( + "Any argument within requires function must be either of type Class or String" + o.getClass()); + + } + + for (Pair, String> onePort : allPorts) { + allCauses.add(new PortBaseImpl(onePort.getValue(), getComponentType(onePort.getKey()))); + } + + for (Pair, String> effect : allPorts) { + + ArrayList causes = (ArrayList) allCauses.clone(); + causes.remove(new PortBaseImpl(effect.getValue(), getComponentType(effect.getKey()))); + + addRequire (effect.getKey(), effect.getValue(), causes); + addAccept (effect.getKey(), effect.getValue(), causes); + } + + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java index 89167d7d..313ad6d3 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitor.java @@ -30,9 +30,9 @@ public class RouteOnOffMonitor { final private int routeLimit; + private boolean workAllowed = true; private int routeOnCounter = 0; - private boolean workAllowed = true; public RouteOnOffMonitor(int routeLimit) { this.routeLimit = routeLimit; diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java new file mode 100644 index 00000000..082df3c6 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java @@ -0,0 +1,114 @@ +package org.javabip.spec; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; +import org.javabip.exceptions.BIPException; + +import java.util.HashMap; +import java.util.Map; + + +@Ports({ + @Port(name = "add", type = PortType.enforceable), + @Port(name = "rm", type = PortType.enforceable), + @Port(name = "switch", type = PortType.spontaneous) +}) +@ComponentType(initial = "0", name = "org.bip.spec.RouteOnOffMonitorWithData") +public class RouteOnOffMonitorWithData { + + private Map compatible; + + private boolean workAllowed = true; + + private String runningRouteId1; + private String runningRouteId2; + + public RouteOnOffMonitorWithData() { + compatible = new HashMap (); + compatible.put("1", "3"); + compatible.put("2", "4"); + compatible.put("3", "1"); + compatible.put("4", "2"); + } + + public RouteOnOffMonitorWithData(boolean workAllowed) { + compatible = new HashMap (); + compatible.put("1", "3"); + compatible.put("2", "4"); + compatible.put("3", "1"); + compatible.put("4", "2"); + + this.workAllowed = workAllowed; + } + + @Transitions({ + @Transition(name = "add", source = "0", target = "1", guard = "canWork & compatible"), + @Transition(name = "add", source = "1", target = "2", guard = "canWork & compatible") + }) + public void addRoute(@Data(name = "routeId") String routeId) throws BIPException { + + if (runningRouteId1 == null) { + System.out.printf("Adding route %s as first route%n", routeId); + runningRouteId1 = routeId; + } else if (runningRouteId2 == null) { + System.out.printf("Adding route %s as second route%n", routeId); + runningRouteId2 = routeId; + } else { + throw new BIPException("Tried adding route " + routeId + + " even though two routes " + runningRouteId1 + " and " + runningRouteId2 + + " are already running"); + } + + System.out.printf(" workAllowed = %b%n", workAllowed); + } + + @Transitions({ + @Transition(name = "rm", source = "2", target = "1", guard = "isRunning"), + @Transition(name = "rm", source = "1", target = "0", guard = "isRunning") + }) + public void removeRoute(@Data(name = "routeId") String routeId) throws BIPException { + + if (runningRouteId1 != null && runningRouteId1.equals(routeId)) { + System.out.printf("Removing route %s as first route%n", routeId); + System.out.printf("Moving route %s from second to first%n", runningRouteId2); + runningRouteId1 = runningRouteId2; + runningRouteId2 = null; + } else if (runningRouteId2 != null && runningRouteId2.equals(routeId)) { + System.out.printf("Removing route %s as second route%n", routeId); + runningRouteId2 = null; + } else { + throw new BIPException("Tried removing route " + routeId + + " even though it is not running"); + } + System.out.printf(" workAllowed = %b%n", workAllowed); + } + + @Transitions({ + @Transition(name = "switch", source = "0", target = "0", guard = ""), + @Transition(name = "switch", source = "1", target = "1", guard = ""), + @Transition(name = "switch", source = "2", target = "2", guard = "") + }) + public void switchWorkAllowed() { + workAllowed = !workAllowed; + + System.out.printf("Switch transition handler for Route Monitor is being executed.%n workAllowed = %b%n", workAllowed); + } + + @Guard(name = "canWork") + public boolean canWork() { + return workAllowed; + } + + @Guard(name = "compatible") + public boolean areRoutesCompatible (@Data(name = "routeId") String routeId + ) { + return (runningRouteId1 == null) || + (runningRouteId2 == null && compatible.get(runningRouteId1).equals(routeId)); + } + + @Guard(name = "isRunning") + public boolean isRunning (@Data(name = "routeId") String routeId) { + return (runningRouteId1 != null && runningRouteId1.equals(routeId)) || + (runningRouteId2 != null && runningRouteId2.equals(routeId)); + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteSimpleMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteSimpleMonitor.java new file mode 100644 index 00000000..11ea31af --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteSimpleMonitor.java @@ -0,0 +1,68 @@ +package org.javabip.spec; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +@Ports({ + @Port(name = "add", type = PortType.enforceable), + @Port(name = "rm", type = PortType.enforceable), + @Port(name = "rmlast", type = PortType.enforceable), + @Port(name = "switch", type = PortType.spontaneous) +}) +@ComponentType(initial = "0", name = "org.bip.spec.RouteSimpleMonitor") +public class RouteSimpleMonitor { + + private int routeOnCounter = 0; + private boolean workAllowed = true; + + public RouteSimpleMonitor () { } + + public RouteSimpleMonitor (boolean workAllowed) { + this.workAllowed = workAllowed; + } + + @Transitions({ + @Transition(name = "add", source = "0", target = "1", guard = "canWork"), + @Transition(name = "add", source = "1", target = "1", guard = "canWork") + }) + public void addRoute() { + routeOnCounter++; + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.printf(" routeOnCounter = %d,%n workAllowed = %b%n", routeOnCounter, workAllowed); + } + + @Transitions({ + @Transition(name = "rm", source = "1", target = "1", guard = "!lastRoute"), + @Transition(name = "rmlast", source = "1", target = "0", guard = "lastRoute") + }) + public void removeRoute() { + routeOnCounter--; + + System.out.printf(" routeOnCounter = %d,%n workAllowed = %b%n", routeOnCounter, workAllowed); + } + + @Transitions({ + @Transition(name = "switch", source = "0", target = "0", guard = ""), + @Transition(name = "switch", source = "1", target = "1", guard = "") + }) + public void switchWorkAllowed() { + workAllowed = !workAllowed; + + System.out.printf("Switch transition handler for Route Monitor is being executed.%n workAllowed = %b%n", workAllowed); + } + + @Guard(name = "canWork") + public boolean canWork() { + return workAllowed; + } + + @Guard(name = "lastRoute") + public boolean lastRoute() { + return routeOnCounter == 1; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteStarter.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteStarter.java new file mode 100644 index 00000000..550d0e2f --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteStarter.java @@ -0,0 +1,49 @@ +package org.javabip.spec; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +@Ports({ + @Port(name = "add", type = PortType.enforceable), + @Port(name = "rm", type = PortType.enforceable), + @Port(name = "switch", type = PortType.spontaneous) +}) +@ComponentType(initial = "0", name = "org.bip.spec.RouteStarter") +public class RouteStarter { + + private boolean workAllowed = true; + + public RouteStarter() { } + + public RouteStarter(boolean workAllowed) { + this.workAllowed = workAllowed; + } + + @Transitions({ + @Transition(name = "add", source = "0", target = "1", guard = "canWork"), + }) + public void addRoute() { + System.out.printf(" workAllowed = %b%n", workAllowed); + } + + @Transitions({ + @Transition(name = "rm", source = "1", target = "0", guard = "!canWork"), + }) + public void removeRoute() { + System.out.printf(" workAllowed = %b%n", workAllowed); + } + + @Transitions({ + @Transition(name = "switch", source = "1", target = "1", guard = "") + }) + public void switchWorkAllowed() { + workAllowed = !workAllowed; + + System.out.printf("Switch transition handler for Route Monitor is being executed.%n workAllowed = %b%n", workAllowed); + } + + @Guard(name = "canWork") + public boolean canWork() { + return workAllowed; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java index 75e78485..a3c4fee2 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java @@ -31,6 +31,7 @@ import org.apache.camel.model.RouteDefinition; import org.apache.camel.spi.RoutePolicy; import org.javabip.annotations.*; +import org.javabip.api.DataOut; import org.javabip.api.Executor; import org.javabip.api.PortType; import org.slf4j.Logger; @@ -83,8 +84,8 @@ public SwitchableRoute(String routeId, CamelContext camelContext) { */ @Transition(name = "off", source = "on", target = "wait", guard = "") public void stopRoute() throws Exception { -// logger.debug("Stop transition handler for {} is being executed.", routeId); - System.out.printf("Stop transition handler for %s is being executed.%n", routeId); +// logger.debug("Off transition handler for route {} is being executed.", routeId); + System.out.printf("'Off' transition handler for %s is being executed.%n", routeId); camelContext.suspendRoute(routeId); noOfEnforcedTransitions++; } @@ -92,26 +93,27 @@ public void stopRoute() throws Exception { @Transition(name = "end", source = "wait", target = "done", guard = "!isFinished") public void spontaneousEnd() throws Exception { // logger.info("Received end notification for the route {}.", routeId); - System.out.printf("Received end notification for the route %s.%n", routeId); + System.out.printf("Received 'end' notification for the route %s.%n", routeId); } @Transition(name = "", source = "wait", target = "done", guard = "isFinished") public void internalEnd() throws Exception { -// logger.info("Transitioning to done state directly since work within {} is already finished.", routeId); - System.out.printf("Transitioning to done state directly since work within %s is already finished.%n", routeId); +// logger.info("Transitioning to done state directly since work within the route {} is already finished.", routeId); + System.out.printf("Transitioning to done state directly (internal) since work within %s is already finished.%n", routeId); } @Transition(name = "finished", source = "done", target = "off", guard = "") public void finishedTransition() throws Exception { noOfEnforcedTransitions++; // logger.debug("Transitioning to off state from done for {}.", routeId); - System.out.printf("Transitioning to off state from done for %s.%n", routeId); + System.out.printf("'Finished' transition handler is being executed " + + "(transitioning directly to off state from done) for route %s.%n", routeId); } @Transition(name = "on", source = "off", target = "on", guard = "") public void startRoute() throws Exception { // logger.debug("Start transition handler for {} is being executed.", routeId); - System.out.printf("Start transition handler for %s is being executed.%n", routeId); + System.out.printf("'On' transition handler for route %s is being executed.%n", routeId); camelContext.resumeRoute(routeId); noOfEnforcedTransitions++; @@ -127,6 +129,13 @@ public boolean isFinished() { return camelContext.getInflightRepository().size(routeId) == 0; } + // It is inferred that this is Data Out as the annotation is provided within a function that returns smth. + // The type of the DataOut is the type of the return. + @Data(name = "id", accessTypePort = DataOut.AccessType.any) + public String getRouteId() { + return routeId; + } + public void afterPropertiesSet() throws Exception { RouteDefinition routeDefinition = camelContext.getRouteDefinition(routeId); @@ -182,7 +191,7 @@ public void onSuspend(Route arg0) { } - public void destroy() throws Exception { + public void destroy() { RouteDefinition routeDefinition = camelContext.getRouteDefinition(routeId); @@ -198,3 +207,5 @@ public void destroy() throws Exception { } } + + diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute1.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute1.java new file mode 100644 index 00000000..3a3ca1d7 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute1.java @@ -0,0 +1,59 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15/10/12 + */ + +package org.javabip.spec; + +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.Exchange; +import org.apache.camel.Route; +import org.apache.camel.model.ModelCamelContext; +import org.apache.camel.model.RouteDefinition; +import org.apache.camel.spi.RoutePolicy; +import org.javabip.annotations.*; +import org.javabip.api.Executor; +import org.javabip.api.PortType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.InitializingBean; + +import java.util.ArrayList; +import java.util.List; + +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) +@ComponentType(initial = "off", name = "org.bip.spec.SwitchableRoute1") +public class SwitchableRoute1 extends SwitchableRoute { + + public SwitchableRoute1 (String routeId) { + super (routeId); + } + + public SwitchableRoute1 (String routeId, CamelContext camelContext) { + super (routeId, camelContext); + } +} + + diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute2.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute2.java new file mode 100644 index 00000000..a60fa51a --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute2.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15/10/12 + */ + +package org.javabip.spec; + +import org.apache.camel.CamelContext; +import org.javabip.annotations.ComponentType; +import org.javabip.annotations.Port; +import org.javabip.annotations.Ports; +import org.javabip.api.PortType; + +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) +@ComponentType(initial = "off", name = "org.bip.spec.SwitchableRoute2") +public class SwitchableRoute2 extends SwitchableRoute { + + public SwitchableRoute2(String routeId) { + super (routeId); + } + + public SwitchableRoute2(String routeId, CamelContext camelContext) { + super (routeId, camelContext); + } +} + + diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute3.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute3.java new file mode 100644 index 00000000..3fac4874 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute3.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15/10/12 + */ + +package org.javabip.spec; + +import org.apache.camel.CamelContext; +import org.javabip.annotations.ComponentType; +import org.javabip.annotations.Port; +import org.javabip.annotations.Ports; +import org.javabip.api.PortType; + +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) +@ComponentType(initial = "off", name = "org.bip.spec.SwitchableRoute3") +public class SwitchableRoute3 extends SwitchableRoute { + + public SwitchableRoute3(String routeId) { + super (routeId); + } + + public SwitchableRoute3(String routeId, CamelContext camelContext) { + super (routeId, camelContext); + } +} + + diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute4.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute4.java new file mode 100644 index 00000000..be0cf37c --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute4.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15/10/12 + */ + +package org.javabip.spec; + +import org.apache.camel.CamelContext; +import org.javabip.annotations.ComponentType; +import org.javabip.annotations.Port; +import org.javabip.annotations.Ports; +import org.javabip.api.PortType; + +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) +@ComponentType(initial = "off", name = "org.bip.spec.SwitchableRoute4") +public class SwitchableRoute4 extends SwitchableRoute { + + public SwitchableRoute4(String routeId) { + super (routeId); + } + + public SwitchableRoute4(String routeId, CamelContext camelContext) { + super (routeId, camelContext); + } +} + + diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteDataTransfers.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteDataTransfers.java index dac9168b..c465e17f 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteDataTransfers.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteDataTransfers.java @@ -47,8 +47,12 @@ // TODO DESIGN, DISCUSS, should all the BIP specs implement MutableIdentification -@Ports({ @Port(name = "end", type = PortType.spontaneous), @Port(name = "on", type = PortType.enforceable), - @Port(name = "off", type = PortType.enforceable), @Port(name = "finished", type = PortType.enforceable) }) +@Ports({ + @Port(name = "end", type = PortType.spontaneous), + @Port(name = "on", type = PortType.enforceable), + @Port(name = "off", type = PortType.enforceable), + @Port(name = "finished", type = PortType.enforceable) +}) @ComponentType(initial = "off", name = "org.bip.spec.SwitchableRouteDataTransfers") public class SwitchableRouteDataTransfers implements CamelContextAware, InitializingBean, DisposableBean, BIPSpec { From 654dd4cd01b00816735c540d911032c377861804 Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Mon, 5 Nov 2018 15:02:07 +0100 Subject: [PATCH 06/19] Updates for the new demo --- .../java/org/javabip/glue/ManySynchronGlueBuilder.java | 2 +- .../java/org/javabip/spec/RouteOnOffMonitorWithData.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java b/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java index e40c1455..5966033a 100644 --- a/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java +++ b/org.javabip.glue/src/main/java/org/javabip/glue/ManySynchronGlueBuilder.java @@ -22,7 +22,7 @@ import org.javabip.api.PortBase; import java.util.ArrayList; -import java.util.stream.Collectors; +//import java.util.stream.Collectors; /** * Glue builder allowing to create synchronous connections between ports. diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java index 082df3c6..97dc64ac 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/RouteOnOffMonitorWithData.java @@ -32,12 +32,7 @@ public RouteOnOffMonitorWithData() { } public RouteOnOffMonitorWithData(boolean workAllowed) { - compatible = new HashMap (); - compatible.put("1", "3"); - compatible.put("2", "4"); - compatible.put("3", "1"); - compatible.put("4", "2"); - + this(); this.workAllowed = workAllowed; } From 4e6e131131c717cc6de03a4a4771fe4cba9ccea0 Mon Sep 17 00:00:00 2001 From: Simon Bliudze Date: Mon, 23 Sep 2019 13:03:50 +0200 Subject: [PATCH 07/19] Minor changes: Version change (1.6 --> 7) in pom.xml -- probably due to IntellIJ upgrade Additional printout in Switchable roots for ease of debugging --- org.javabip.executor/pom.xml | 4 ++-- .../src/main/java/org/javabip/spec/SwitchableRoute.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/org.javabip.executor/pom.xml b/org.javabip.executor/pom.xml index 67490186..64a90aed 100644 --- a/org.javabip.executor/pom.xml +++ b/org.javabip.executor/pom.xml @@ -119,8 +119,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 7 + 7 diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java index a3c4fee2..238e72fd 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRoute.java @@ -88,6 +88,7 @@ public void stopRoute() throws Exception { System.out.printf("'Off' transition handler for %s is being executed.%n", routeId); camelContext.suspendRoute(routeId); noOfEnforcedTransitions++; + System.out.printf("'Off' transition handler for %s done.%n", routeId); } @Transition(name = "end", source = "wait", target = "done", guard = "!isFinished") From f8c500867ddaa4013c100f80d01abe2daa5d1d1b Mon Sep 17 00:00:00 2001 From: lsafina Date: Fri, 16 Apr 2021 15:36:37 +0300 Subject: [PATCH 08/19] bug-fix for Executor.getData (clazz.isAssignableFrom(methodResult.getClass()) --- .../src/main/java/org/javabip/executor/ExecutorKernel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java index d33e3dd0..ad8f1101 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java @@ -317,7 +317,7 @@ public T getData(String name, Class clazz) { args[0] = bipComponent; Object methodResult = behaviour.getDataOutMapping().get(name).invokeWithArguments(args); - if (!clazz.equals(Object.class) && !methodResult.getClass().isAssignableFrom(clazz)) { + if (!clazz.equals(Object.class) && !clazz.isAssignableFrom(methodResult.getClass())) { result = getPrimitiveData(name, methodResult, clazz); } else result = clazz.cast(methodResult); From d8c3ef0a5310dbae6ca5212d7c3a70792a787f92 Mon Sep 17 00:00:00 2001 From: lsafina Date: Thu, 3 Jun 2021 20:54:34 +0200 Subject: [PATCH 09/19] using copyTo in datawire for deep copy --- org.javabip.api/pom.xml | 4 +-- .../main/java/org/javabip/api/DataWire.java | 7 ++++ org.javabip.glue/pom.xml | 15 ++++++++ .../java/org/javabip/glue/BIPGlueImpl.java | 15 ++++---- .../java/org/javabip/glue/DataWireImpl.java | 19 ++++++++-- .../java/org/javabip/glue/GlueBuilder.java | 36 +++++++++++-------- org.javabip.spec.examples/pom.xml | 18 +++++++++- 7 files changed, 85 insertions(+), 29 deletions(-) diff --git a/org.javabip.api/pom.xml b/org.javabip.api/pom.xml index a592151b..5dbba290 100644 --- a/org.javabip.api/pom.xml +++ b/org.javabip.api/pom.xml @@ -51,8 +51,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 7 + 7 diff --git a/org.javabip.api/src/main/java/org/javabip/api/DataWire.java b/org.javabip.api/src/main/java/org/javabip/api/DataWire.java index 98b3086e..f33177e7 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/DataWire.java +++ b/org.javabip.api/src/main/java/org/javabip/api/DataWire.java @@ -39,6 +39,13 @@ public interface DataWire { */ public PortBase getTo(); + /** + * Gets the port to which the data is being sent to. + * + * @return the port to which the data is being sent to. + */ + public Boolean isCopy(); + /** * Checks if the given input data of the given component type is at the incoming end of the wire. The function is * used by the BIP Engine. diff --git a/org.javabip.glue/pom.xml b/org.javabip.glue/pom.xml index 602523dc..0f73105c 100644 --- a/org.javabip.glue/pom.xml +++ b/org.javabip.glue/pom.xml @@ -24,6 +24,21 @@ org.javabip org.javabip.api + + javax.xml.bind + jaxb-api + 2.3.1 + + + javax.annotation + javax.annotation-api + 1.3.2 + + + org.openjfx + javafx-base + 17-ea+11 + diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/BIPGlueImpl.java b/org.javabip.glue/src/main/java/org/javabip/glue/BIPGlueImpl.java index e5b7a4b5..54ff0110 100644 --- a/org.javabip.glue/src/main/java/org/javabip/glue/BIPGlueImpl.java +++ b/org.javabip.glue/src/main/java/org/javabip/glue/BIPGlueImpl.java @@ -18,8 +18,10 @@ */ package org.javabip.glue; -import java.io.OutputStream; -import java.util.ArrayList; +import org.javabip.api.Accept; +import org.javabip.api.BIPGlue; +import org.javabip.api.DataWire; +import org.javabip.api.Require; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; @@ -27,11 +29,8 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; - -import org.javabip.api.Accept; -import org.javabip.api.BIPGlue; -import org.javabip.api.DataWire; -import org.javabip.api.Require; +import java.io.OutputStream; +import java.util.ArrayList; /** * Class implementing the functionality of the BIP Glue. @@ -72,7 +71,7 @@ public BIPGlueImpl(ArrayList acceptConstraints, ArrayList requi this.dataWires = new ArrayList(); for (DataWire dataWire : dataWires) { - this.dataWires.add(new DataWireImpl(dataWire.getFrom(), dataWire.getTo())); + this.dataWires.add(new DataWireImpl(dataWire.getFrom(), dataWire.getTo(), dataWire.isCopy())); } } diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/DataWireImpl.java b/org.javabip.glue/src/main/java/org/javabip/glue/DataWireImpl.java index 3848fd7d..061adfcc 100644 --- a/org.javabip.glue/src/main/java/org/javabip/glue/DataWireImpl.java +++ b/org.javabip.glue/src/main/java/org/javabip/glue/DataWireImpl.java @@ -18,11 +18,11 @@ */ package org.javabip.glue; -import javax.xml.bind.annotation.XmlElement; - import org.javabip.api.DataWire; import org.javabip.api.PortBase; +import javax.xml.bind.annotation.XmlElement; + /** * Class implementing the data wire functionality. Data wires are sued to specify the data connections between different * components. @@ -36,12 +36,15 @@ class DataWireImpl implements DataWire { @XmlElement(name = "to") private PortBaseImpl to; + private Boolean isCopy; + public DataWireImpl() { } - public DataWireImpl(PortBase from, PortBase to) { + public DataWireImpl(PortBase from, PortBase to, Boolean copy) { this.from = new PortBaseImpl(from.getId(), from.getSpecType()); this.to = new PortBaseImpl(to.getId(), to.getSpecType()); + this.isCopy = copy; } public PortBase getFrom() { @@ -52,6 +55,16 @@ public PortBase getTo() { return to; } + /** + * Gets the boolean value indicating if the data shall be copied or passed by reference + * + * @return true if the value shall be copied, false otherwise + */ + @Override + public Boolean isCopy() { + return isCopy; + } + /** * Defines whether this wire provides this required data for this requiring component. * diff --git a/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java b/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java index 60e25f9c..a2eed255 100644 --- a/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java +++ b/org.javabip.glue/src/main/java/org/javabip/glue/GlueBuilder.java @@ -18,24 +18,17 @@ */ package org.javabip.glue; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.annotation.Annotation; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import org.javabip.annotations.ComponentType; +import org.javabip.api.BIPGlue; +import org.javabip.api.PortBase; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; - -import org.javabip.annotations.ComponentType; -import org.javabip.api.BIPGlue; -import org.javabip.api.PortBase; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.annotation.Annotation; +import java.util.*; /** * Provides functionality to build BIP Glue. @@ -339,7 +332,20 @@ public void to(Class spec, String dataId) { if (dataId.equals("")) throw new IllegalArgumentException("DataId can not be an empty string."); - glue.addDataWire(new DataWireImpl(from, new PortBaseImpl(dataId, getComponentType(spec)))); + glue.addDataWire(new DataWireImpl(from, new PortBaseImpl(dataId, getComponentType(spec)), false)); + + } + + public void copyTo(Class spec, String dataId) { + + if (dataId == null) + throw new IllegalArgumentException("DataId can not be null."); + if (spec == null) + throw new IllegalArgumentException("Spec type can not be null"); + if (dataId.equals("")) + throw new IllegalArgumentException("DataId can not be an empty string."); + + glue.addDataWire(new DataWireImpl(from, new PortBaseImpl(dataId, getComponentType(spec)), true)); } diff --git a/org.javabip.spec.examples/pom.xml b/org.javabip.spec.examples/pom.xml index 3d7ff5c6..88f53274 100644 --- a/org.javabip.spec.examples/pom.xml +++ b/org.javabip.spec.examples/pom.xml @@ -74,6 +74,14 @@ org.javabip org.javabip.executor + + com.typesafe.akka + akka-actor_2.11 + + + org.javabip + org.javabip.engine.factory + @@ -118,7 +126,15 @@ 1.6 - + + org.apache.maven.plugins + maven-compiler-plugin + + 7 + 7 + + + From c9da8d091b3ca8563ff3f24f602ab2aa76d57855 Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 23 Feb 2022 15:56:06 +0300 Subject: [PATCH 10/19] adding new annotations --- .../org/javabip/annotations/Invariant.java | 38 ++ .../java/org/javabip/annotations/Pure.java | 30 ++ .../javabip/annotations/StatePredicate.java | 45 +++ .../org/javabip/annotations/Transition.java | 18 +- .../main/java/org/javabip/api/Invariant.java | 34 ++ .../src/main/java/org/javabip/api/Pure.java | 26 ++ .../java/org/javabip/api/StatePredicate.java | 37 ++ .../main/java/org/javabip/api/Transition.java | 14 + org.javabip.executor/pom.xml | 4 +- .../javabip/executor/BehaviourBuilder.java | 49 +-- .../executor/ExecutableTransitionImpl.java | 18 +- .../org/javabip/executor/InvariantImpl.java | 55 +++ .../javabip/executor/SpecificationParser.java | 326 +++++++++--------- .../org/javabip/executor/TransitionImpl.java | 20 +- 14 files changed, 506 insertions(+), 208 deletions(-) create mode 100644 org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java create mode 100644 org.javabip.api/src/main/java/org/javabip/annotations/Pure.java create mode 100644 org.javabip.api/src/main/java/org/javabip/annotations/StatePredicate.java create mode 100644 org.javabip.api/src/main/java/org/javabip/api/Invariant.java create mode 100644 org.javabip.api/src/main/java/org/javabip/api/Pure.java create mode 100644 org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java create mode 100644 org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java b/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java new file mode 100644 index 00000000..ca87e8c6 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java @@ -0,0 +1,38 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 + */ + +package org.javabip.annotations; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * An invariant annotation, which specifies the invariant of a component + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface Invariant { + + /** + * expr is a string containing plain Java expressions + * it must hold after construction of the component, can be assumed to hold before a transition, and must hold after a transition + * @return expr + */ + String expr(); +} diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/Pure.java b/org.javabip.api/src/main/java/org/javabip/annotations/Pure.java new file mode 100644 index 00000000..09b74728 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/annotations/Pure.java @@ -0,0 +1,30 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 + */ + +package org.javabip.annotations; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * An pure annotation indicates that the method is a side-effect free heap-dependent method + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface Pure {} diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicate.java b/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicate.java new file mode 100644 index 00000000..99c83dfd --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicate.java @@ -0,0 +1,45 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 + */ + +package org.javabip.annotations; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * A state predicate annotation + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface StatePredicate { + + /** + * state is a string containing the name of the state + * @return the name of the state. + */ + String state(); + + /** + * expr is a string containing plain Java expressions + * it must hold when the state is entered. + * when the component moves to a new state, expr may be assumed to hold at the start of the transition + * @return expr. + */ + String expr(); +} diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/Transition.java b/org.javabip.api/src/main/java/org/javabip/annotations/Transition.java index b1ec9895..b986d32a 100644 --- a/org.javabip.api/src/main/java/org/javabip/annotations/Transition.java +++ b/org.javabip.api/src/main/java/org/javabip/annotations/Transition.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina - * Date: 15.10.12 + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 */ package org.javabip.annotations; @@ -59,4 +59,18 @@ */ String guard() default ""; + /** + * pre condition that is supposed to hold before the execution of the update function + * can be useful to check properties specific to a transition, which you don’t want to put in a state predicate or component invariant + * @return pre condition + */ + String pre() default ""; + + /** + * post condition that is supposed to hold after the execution of the update function + * can be useful to check properties specific to a transition, which you don’t want to put in a state predicate or component invariant + * @return post condition + */ + String post() default ""; + } diff --git a/org.javabip.api/src/main/java/org/javabip/api/Invariant.java b/org.javabip.api/src/main/java/org/javabip/api/Invariant.java new file mode 100644 index 00000000..dd22828d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/api/Invariant.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 + */ + +package org.javabip.api; + +/** + * It specifies the interface for class invariant + */ +public interface Invariant { + + /** + * @return the invariant expression + */ + public String expr(); + + public boolean evaluateInvariant(); +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/api/Pure.java b/org.javabip.api/src/main/java/org/javabip/api/Pure.java new file mode 100644 index 00000000..4fac0614 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/api/Pure.java @@ -0,0 +1,26 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15.10.12 + */ + +package org.javabip.api; + +/** + * It specifies the interface for pure annotation + */ +public interface Pure { } \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java b/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java new file mode 100644 index 00000000..ba836e3f --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java @@ -0,0 +1,37 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek and Alina Zolotukhina + * Date: 15.10.13 + */ + +package org.javabip.api; + +/** + * Interface used to specify the state predicate + */ +public interface StatePredicate { + + /** + * @return the name of the predicate + */ + public String name(); + + /** + * @return the expression + */ + public String expr(); +} diff --git a/org.javabip.api/src/main/java/org/javabip/api/Transition.java b/org.javabip.api/src/main/java/org/javabip/api/Transition.java index 97381149..6374ca9a 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/Transition.java +++ b/org.javabip.api/src/main/java/org/javabip/api/Transition.java @@ -33,6 +33,20 @@ public interface Transition { */ public String guard(); + /** + * It gets the string containing the pre expression of the transition. + * + * @return the pre expression. + */ + public String pre(); + + /** + * It gets the string containing the post expression of the transition. + * + * @return the post expression. + */ + public String post(); + /** * It returns the name of transition. * diff --git a/org.javabip.executor/pom.xml b/org.javabip.executor/pom.xml index 64a90aed..c28f21fd 100644 --- a/org.javabip.executor/pom.xml +++ b/org.javabip.executor/pom.xml @@ -119,8 +119,8 @@ org.apache.maven.plugins maven-compiler-plugin - 7 - 7 + 8 + 8 diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java index f9542b41..ff066298 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java @@ -18,26 +18,16 @@ */ package org.javabip.executor; +import org.javabip.api.*; +import org.javabip.exceptions.BIPException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.javabip.api.ComponentProvider; -import org.javabip.api.Data; -import org.javabip.api.ExecutableBehaviour; -import org.javabip.api.Guard; -import org.javabip.api.Port; -import org.javabip.api.PortType; -import org.javabip.exceptions.BIPException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; // TODO, EXTENSION autoboxing between for example int and Integer may be a good feature to help wire data from multiple components. @@ -220,21 +210,21 @@ public void addState(String state) { /** * Adds a transition without data and its source and target states. - * - * @param name + * @param name * transition name * @param source * source state * @param target - * target state + * target state * @param guard - * the guard expression +* the guard expression + * @param pre + * @param post * @param method - * the method representing the transition */ - public void addTransitionAndStates(String name, String source, String target, String guard, Method method) { + public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method) { - addTransitionAndStates(name, source, target, guard, method, ReflectionHelper.parseDataAnnotations(method)); + addTransitionAndStates(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); } @@ -254,7 +244,7 @@ public void addTransitionAndStates(String name, String source, String target, St * @param data * the list of data required by the transition */ - public void addTransitionAndStates(String name, String source, String target, String guard, Method method, + public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method, List> data) { if (!allPorts.containsKey(name)) { @@ -269,7 +259,7 @@ public void addTransitionAndStates(String name, String source, String target, St addState(source); addState(target); - allTransitions.add(new TransitionImpl(name, source, target, guard, method, data)); + allTransitions.add(new TransitionImpl(name, source, target, guard, pre, post, method, data)); } /** @@ -286,9 +276,8 @@ public void addTransitionAndStates(String name, String source, String target, St * @param method * the method representing the transition */ - public void addTransition(String name, String source, String target, String guard, Method method) { - - addTransition(name, source, target, guard, method, ReflectionHelper.parseDataAnnotations(method)); + public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method) { + addTransition(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); } /** @@ -307,7 +296,7 @@ public void addTransition(String name, String source, String target, String guar * @param data * the list of data required by the transition */ - public void addTransition(String name, String source, String target, String guard, Method method, List> data) { + public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method, List> data) { if (!allPorts.containsKey(name)) { if (name == null) @@ -326,7 +315,7 @@ public void addTransition(String name, String source, String target, String guar throw new BIPException("Transition " + name + " is specifying target state " + target + " that has not been explicitly stated before."); - allTransitions.add(new TransitionImpl(name, source, target, guard, method, data)); + allTransitions.add(new TransitionImpl(name, source, target, guard, pre, post, method, data)); } /** diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutableTransitionImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutableTransitionImpl.java index c87fb78d..60ed4a03 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutableTransitionImpl.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutableTransitionImpl.java @@ -18,11 +18,6 @@ */ package org.javabip.executor; -import java.lang.invoke.MethodHandle; -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.Map; - import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CommonTokenStream; import org.javabip.api.Data; @@ -34,6 +29,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandle; +import java.lang.reflect.Method; +import java.util.Collection; +import java.util.Map; + /** * Extends Transition and provides information about a transition relevant to an executor. It has additional guard * information. @@ -80,6 +80,14 @@ public String guard() { return this.guard; } + public String pre() { + return this.pre; + } + + public String post() { + return this.post; + } + public GuardTreeNode guardTree() { return this.guardTree; } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java new file mode 100644 index 00000000..bc49a4ed --- /dev/null +++ b/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java @@ -0,0 +1,55 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Larisa Safina, Radoslaw Szymanek and Alina Zolotukhina + * Date: 23.02.22 + */ + +package org.javabip.executor; + +import org.javabip.api.Invariant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class InvariantImpl implements Invariant { + + private Logger logger = LoggerFactory.getLogger(InvariantImpl.class); + + private String expr; + + public InvariantImpl(String expr) { + this.expr = expr; + } + + public String expr() { + return expr; + } + + public String toString() { + + StringBuilder result = new StringBuilder(); + + result.append("Invariant=("); + result.append("expr = " + expr()); + result.append(")"); + + return result.toString(); + } + + public boolean evaluateInvariant() { + throw new UnsupportedOperationException(); + } +} diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java index fdfc2cb5..9f11c676 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java @@ -1,13 +1,13 @@ /* * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland * Copyright 2012-2016 Crossing-Tech SA, Switzerland - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,202 +19,208 @@ package org.javabip.executor; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; - -import org.javabip.annotations.ComponentType; -import org.javabip.annotations.Data; -import org.javabip.annotations.Ports; -import org.javabip.annotations.Transitions; +import org.javabip.annotations.*; import org.javabip.api.Behaviour; import org.javabip.api.ComponentProvider; import org.javabip.api.ExecutableBehaviour; import org.javabip.exceptions.BIPException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; + /** * Parses the component specification to create a behaviour instance. The behaviour is specified either via annotations * of programmatically. - * + * * @author Alina Zolotukhina */ public abstract class SpecificationParser implements ComponentProvider { - protected Object bipComponent; - protected ExecutableBehaviour behaviour; - protected Class componentClass; - - /** - * Creates an instance of SpecificationParserю - * - * @param bipComponent - * the BIP component specification to parse - * @param useAnnotationSpec - * true, if the annotations are used; false, if the behaviour is specified programmatically - * @throws BIPException - */ - public SpecificationParser(Object bipComponent, boolean useAnnotationSpec) throws BIPException { - this.bipComponent = bipComponent; - this.componentClass = bipComponent.getClass(); - - if (useAnnotationSpec) { - this.behaviour = parseAnnotations(bipComponent.getClass()).build(this); - } else { - this.behaviour = getExecutableBehaviour(bipComponent.getClass()).build(this); - } - - } - - public Behaviour getBehaviour() { - return behaviour; - } - - private BehaviourBuilder getExecutableBehaviour(Class componentClass) throws BIPException { - - Method[] componentMethods = componentClass.getMethods(); - for (Method method : componentMethods) { - Annotation[] annotations = method.getAnnotations(); - for (Annotation annotation : annotations) { - if (annotation instanceof org.javabip.annotations.ExecutableBehaviour) { - Class returnType = method.getReturnType(); - if (!BehaviourBuilder.class.isAssignableFrom(returnType)) { - throw new BIPException("Method " + method.getName() - + "annotated with @ExecutableBehaviour should have a return type BehaviourBuilder"); - } - try { - if (method.getParameterTypes() != null && method.getParameterTypes().length != 0) { - throw new BIPException("The method " + method.getName() - + " for getting executable behaviour for component " - + bipComponent.getClass().getName() + "must have no arguments."); - } - return (BehaviourBuilder) method.invoke(bipComponent); - } catch (Exception e) { - throw new BIPException( - "Method annotated with ExecutableBehavior annotation threw exception upon execution", e); - } - } - } - } - - throw new BIPException("No annotation ExecutableBehaviour found in class " + componentClass.getCanonicalName()); - - } - - private BehaviourBuilder parseAnnotations(Class componentClass) throws BIPException { - BehaviourBuilder builder = new BehaviourBuilder(bipComponent); - - String specType = ""; - // TODO: Add simple test that forgets the componentType annotation to see whether the - // Exception (else part) is thrown. - Annotation classAnnotation = componentClass.getAnnotation(ComponentType.class); - // get component name and type - if (classAnnotation instanceof ComponentType) { - ComponentType componentTypeAnnotation = (ComponentType) classAnnotation; - builder.setComponentType(componentTypeAnnotation.name()); - specType = componentTypeAnnotation.name(); - builder.setInitialState(componentTypeAnnotation.initial()); - } else { - throw new BIPException("ComponentType annotation is not specified."); - } - - // get ports - classAnnotation = componentClass.getAnnotation(Ports.class); - if (classAnnotation instanceof Ports) { - Ports ports = (Ports) classAnnotation; - org.javabip.annotations.Port[] portArray = ports.value(); - for (org.javabip.annotations.Port bipPortAnnotation : portArray) { - - if (bipPortAnnotation instanceof org.javabip.annotations.Port) - addPort((org.javabip.annotations.Port) bipPortAnnotation, specType, builder); - - } - } else { - throw new BIPException("Port information for the BIP component is not specified."); - } - - // get transitions & guards & data - Method[] componentMethods = componentClass.getMethods(); - for (Method method : componentMethods) { - Annotation[] annotations = method.getAnnotations(); - for (Annotation annotation : annotations) { - if (annotation instanceof org.javabip.annotations.Transition) { - - addTransitionAndStates(method, (org.javabip.annotations.Transition) annotation, builder); - - } else if (annotation instanceof Transitions) { - Transitions transitionsAnnotation = (Transitions) annotation; - Annotation[] transitionAnnotations = transitionsAnnotation.value(); - for (Annotation bipTransitionAnnotation : transitionAnnotations) { + protected Object bipComponent; + protected ExecutableBehaviour behaviour; + protected Class componentClass; + + /** + * Creates an instance of SpecificationParser + * + * @param bipComponent the BIP component specification to parse + * @param useAnnotationSpec true, if the annotations are used; false, if the behaviour is specified programmatically + * @throws BIPException + */ + public SpecificationParser(Object bipComponent, boolean useAnnotationSpec) throws BIPException { + this.bipComponent = bipComponent; + this.componentClass = bipComponent.getClass(); + + if (useAnnotationSpec) { + this.behaviour = parseAnnotations(bipComponent.getClass()).build(this); + } else { + this.behaviour = getExecutableBehaviour(bipComponent.getClass()).build(this); + } + + } + + public Behaviour getBehaviour() { + return behaviour; + } + + private BehaviourBuilder getExecutableBehaviour(Class componentClass) throws BIPException { + + Method[] componentMethods = componentClass.getMethods(); + for (Method method : componentMethods) { + Annotation[] annotations = method.getAnnotations(); + for (Annotation annotation : annotations) { + if (annotation instanceof org.javabip.annotations.ExecutableBehaviour) { + Class returnType = method.getReturnType(); + if (!BehaviourBuilder.class.isAssignableFrom(returnType)) { + throw new BIPException("Method " + method.getName() + + "annotated with @ExecutableBehaviour should have a return type BehaviourBuilder"); + } + try { + if (method.getParameterTypes() != null && method.getParameterTypes().length != 0) { + throw new BIPException("The method " + method.getName() + + " for getting executable behaviour for component " + + bipComponent.getClass().getName() + "must have no arguments."); + } + return (BehaviourBuilder) method.invoke(bipComponent); + } catch (Exception e) { + throw new BIPException( + "Method annotated with ExecutableBehavior annotation threw exception upon execution", e); + } + } + } + } + + throw new BIPException("No annotation ExecutableBehaviour found in class " + componentClass.getCanonicalName()); + + } + + private BehaviourBuilder parseAnnotations(Class componentClass) throws BIPException { + BehaviourBuilder builder = new BehaviourBuilder(bipComponent); + + String specType = ""; + // TODO: Add simple test that forgets the componentType annotation to see whether the + // Exception (else part) is thrown. + Annotation classAnnotation = componentClass.getAnnotation(ComponentType.class); + // get component name and type + if (classAnnotation instanceof ComponentType) { + ComponentType componentTypeAnnotation = (ComponentType) classAnnotation; + builder.setComponentType(componentTypeAnnotation.name()); + specType = componentTypeAnnotation.name(); + builder.setInitialState(componentTypeAnnotation.initial()); + } else { + throw new BIPException("ComponentType annotation is not specified."); + } + + // get ports + classAnnotation = componentClass.getAnnotation(Ports.class); + if (classAnnotation instanceof Ports) { + Ports ports = (Ports) classAnnotation; + org.javabip.annotations.Port[] portArray = ports.value(); + for (org.javabip.annotations.Port bipPortAnnotation : portArray) { + + if (bipPortAnnotation instanceof org.javabip.annotations.Port) + addPort((org.javabip.annotations.Port) bipPortAnnotation, specType, builder); + + } + } else { + throw new BIPException("Port information for the BIP component is not specified."); + } + + // get transitions & guards & data + Method[] componentMethods = componentClass.getMethods(); + for (Method method : componentMethods) { + Annotation[] annotations = method.getAnnotations(); + for (Annotation annotation : annotations) { + if (annotation instanceof org.javabip.annotations.Transition) { + + addTransitionAndStates(method, (org.javabip.annotations.Transition) annotation, builder); + + } + else if (annotation instanceof Transitions) { + Transitions transitionsAnnotation = (Transitions) annotation; + Annotation[] transitionAnnotations = transitionsAnnotation.value(); + for (Annotation bipTransitionAnnotation : transitionAnnotations) { addTransitionAndStates(method, (org.javabip.annotations.Transition) bipTransitionAnnotation, - builder); - } - - } else if (annotation instanceof org.javabip.annotations.Guard) { + builder); + } + } + else if (annotation instanceof org.javabip.annotations.Guard) { - addGuard(method, (org.javabip.annotations.Guard) annotation, builder); + addGuard(method, (org.javabip.annotations.Guard) annotation, builder); - } else if (annotation instanceof Data) { // DATA OUT + } + else if (annotation instanceof Data) { // DATA OUT - addData(method, (Data) annotation, builder); + addData(method, (Data) annotation, builder); - // TODO DESIGN Do we really make it possible to specify Port(s) directly within the function? - } else if (annotation instanceof Ports) { - Ports portsAnnotation = (Ports) annotation; - Annotation[] portAnnotations = portsAnnotation.value(); - for (Annotation bipPortAnnotation : portAnnotations) { + // TODO DESIGN Do we really make it possible to specify Port(s) directly within the function? + } + else if (annotation instanceof Ports) { + Ports portsAnnotation = (Ports) annotation; + Annotation[] portAnnotations = portsAnnotation.value(); + for (Annotation bipPortAnnotation : portAnnotations) { - if (bipPortAnnotation instanceof org.javabip.annotations.Port) - addPort((org.javabip.annotations.Port) bipPortAnnotation, componentClass, builder); + if (bipPortAnnotation instanceof org.javabip.annotations.Port) + addPort((org.javabip.annotations.Port) bipPortAnnotation, componentClass, builder); - } + } - } else if (annotation instanceof org.javabip.annotations.Port) { + } + else if (annotation instanceof org.javabip.annotations.Port) { - addPort((org.javabip.annotations.Port) annotation, componentClass, builder); + addPort((org.javabip.annotations.Port) annotation, componentClass, builder); + } + else if (annotation instanceof Invariant) { + throw new UnsupportedOperationException(); } + else if (annotation instanceof Pure) { + throw new UnsupportedOperationException(); + } + else if (annotation instanceof StatePredicate) { + throw new UnsupportedOperationException(); + } + } + } + return builder; + } - } - - } - return builder; - } - - private void addGuard(Method method, org.javabip.annotations.Guard annotation, BehaviourBuilder builder) - throws BIPException { + private void addGuard(Method method, org.javabip.annotations.Guard annotation, BehaviourBuilder builder) + throws BIPException { - Class returnType = method.getReturnType(); - if (!Boolean.class.isAssignableFrom(returnType) && !boolean.class.isAssignableFrom(returnType)) { - throw new BIPException("Guard method " + method.getName() + " should be a boolean function"); - } + Class returnType = method.getReturnType(); + if (!Boolean.class.isAssignableFrom(returnType) && !boolean.class.isAssignableFrom(returnType)) { + throw new BIPException("Guard method " + method.getName() + " should be a boolean function"); + } - builder.addGuard(annotation.name(), method, ReflectionHelper.parseDataAnnotations(method)); + builder.addGuard(annotation.name(), method, ReflectionHelper.parseDataAnnotations(method)); - } + } - private void addData(Method method, Data annotation, BehaviourBuilder builder) { + private void addData(Method method, Data annotation, BehaviourBuilder builder) { - builder.addDataOut(method, annotation); + builder.addDataOut(method, annotation); - } + } - private void addTransitionAndStates(Method method, org.javabip.annotations.Transition transitionAnnotation, - BehaviourBuilder builder) { + private void addTransitionAndStates(Method method, org.javabip.annotations.Transition transitionAnnotation, + BehaviourBuilder builder) { builder.addTransitionAndStates(transitionAnnotation.name(), transitionAnnotation.source(), - transitionAnnotation.target(), transitionAnnotation.guard(), method); + transitionAnnotation.target(), transitionAnnotation.guard(), transitionAnnotation.pre(), transitionAnnotation.post(), method); - } + } - private void addPort(org.javabip.annotations.Port portAnnotation, Class componentClass, BehaviourBuilder builder) { + private void addPort(org.javabip.annotations.Port portAnnotation, Class componentClass, BehaviourBuilder builder) { - builder.addPort(portAnnotation.name(), portAnnotation.type(), componentClass); + builder.addPort(portAnnotation.name(), portAnnotation.type(), componentClass); - } + } - private void addPort(org.javabip.annotations.Port portAnnotation, String specType, BehaviourBuilder builder) { - builder.addPort(portAnnotation.name(), portAnnotation.type(), specType); + private void addPort(org.javabip.annotations.Port portAnnotation, String specType, BehaviourBuilder builder) { + builder.addPort(portAnnotation.name(), portAnnotation.type(), specType); - } + } } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java index 69e4556c..78a6189b 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java @@ -19,15 +19,15 @@ */ package org.javabip.executor; +import org.javabip.api.Data; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.reflect.Method; -import org.javabip.api.Data; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Stores the transition information about name, source state, target state, guard, method and required data. * @@ -41,6 +41,8 @@ class TransitionImpl { protected String target; // Empty string represents that there is no guard associated to this transition. protected String guard; + protected String pre; + protected String post; protected Method method; protected MethodHandle methodHandle; protected Iterable> dataRequired; @@ -63,21 +65,21 @@ class TransitionImpl { * @param dataRequired * a list of data items that are required by the transition, parameters in the method signature. */ - public TransitionImpl(String name, String source, String target, String guard, Method method, + public TransitionImpl(String name, String source, String target, String guard, String pre, String post, Method method, Iterable> dataRequired) { - if (guard == null) - guard = ""; this.name = name; this.source = source; this.target = target; - this.guard = guard; + this.guard = guard == null? "" : guard; + this.pre = pre == null? "" : pre; + this.post = post == null? "" : post; this.method = method; this.methodHandle = getMethodHandleForTransition(); this.dataRequired = dataRequired; } public TransitionImpl(TransitionImpl transition) { - this(transition.name, transition.source, transition.target, transition.guard, transition.method, + this(transition.name, transition.source, transition.target, transition.guard, transition.pre, transition.post, transition.method, transition.dataRequired); } From d42e481b90ded670bd4dae920e95764abfd8dae4 Mon Sep 17 00:00:00 2001 From: lsafina Date: Tue, 22 Mar 2022 16:34:10 +0100 Subject: [PATCH 11/19] added StatePredicates.java --- .../javabip/annotations/StatePredicates.java | 39 +++++++++++++++++++ .../main/java/org/javabip/api/BIPEngine.java | 2 +- org.javabip.executor/pom.xml | 6 +++ .../org/javabip/executor/ExecutorKernel.java | 23 +++-------- org.javabip.glue/pom.xml | 4 +- org.javabip.spec.examples/pom.xml | 4 +- .../java/org/javabip/spec/ComponentA.java | 3 ++ .../spec/PResizableBehaviorComponent.java | 6 +-- .../SwitchableRouteExecutableBehavior.java | 10 ++--- .../org/javabip/spec/hanoi/HanoiMonitor.java | 12 +++--- .../spec/hanoi/HanoiOptimalMonitor.java | 12 +++--- .../java/org/javabip/spec/hanoi/HanoiPeg.java | 4 +- .../javabip/spec/hanoi/HanoiPegWithData.java | 4 +- 13 files changed, 83 insertions(+), 46 deletions(-) create mode 100644 org.javabip.api/src/main/java/org/javabip/annotations/StatePredicates.java diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicates.java b/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicates.java new file mode 100644 index 00000000..a2b987b8 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/annotations/StatePredicates.java @@ -0,0 +1,39 @@ +/* + * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland + * Copyright 2012-2016 Crossing-Tech SA, Switzerland + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Simon Bliudze, Anastasia Mavridou, Radoslaw Szymanek, Alina Zolotukhina and Larisa Safina + * Date: 22.03.22 + */ + +package org.javabip.annotations; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * It makes it possible to assign multiple state predicates within one function. + * + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface StatePredicates { + + /** + * It returns the array of transitions. + * + * @return array of transitions. + */ + StatePredicate[] value(); +} diff --git a/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java b/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java index 471ce1e8..475c843d 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java +++ b/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java @@ -83,7 +83,7 @@ void informSpecific(BIPComponent decidingComponent, Port decidingPort, /** * It starts the BIP engine thread. */ - void start(); + void start() throws Exception; /** * It stops the BIP engine thread. diff --git a/org.javabip.executor/pom.xml b/org.javabip.executor/pom.xml index c28f21fd..8e77c5f8 100644 --- a/org.javabip.executor/pom.xml +++ b/org.javabip.executor/pom.xml @@ -63,6 +63,12 @@ junit test + + javax.xml.bind + jaxb-api + 2.3.1 + compile + diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java index ad8f1101..95c5f734 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java @@ -8,27 +8,15 @@ package org.javabip.executor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.javabip.api.BIPActorAware; -import org.javabip.api.BIPComponent; -import org.javabip.api.BIPEngine; -import org.javabip.api.Behaviour; -import org.javabip.api.ComponentProvider; -import org.javabip.api.OrchestratedExecutor; -import org.javabip.api.Port; -import org.javabip.api.PortBase; +import org.javabip.api.*; import org.javabip.exceptions.BIPException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.InvocationTargetException; +import java.time.LocalDateTime; +import java.util.*; + /** * The Kernel Executor which performs the execution of the corresponding BIP Component via its Behaviour. It is not a * multi-thread safe executor kernel therefore it should never be directly used. It needs to be proxied to protect it @@ -262,6 +250,7 @@ else if (!behaviour.existInCurrentStateAndEnabledEnforceableWithoutData(guardToV + " that requires data is not enabled for the received data"); } } catch (Exception e) { + System.out.println("start" + LocalDateTime.now()); throw new BIPException(e); } diff --git a/org.javabip.glue/pom.xml b/org.javabip.glue/pom.xml index 0f73105c..86daa84c 100644 --- a/org.javabip.glue/pom.xml +++ b/org.javabip.glue/pom.xml @@ -55,8 +55,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 1.8 + 1.8 diff --git a/org.javabip.spec.examples/pom.xml b/org.javabip.spec.examples/pom.xml index 88f53274..ced48750 100644 --- a/org.javabip.spec.examples/pom.xml +++ b/org.javabip.spec.examples/pom.xml @@ -130,8 +130,8 @@ org.apache.maven.plugins maven-compiler-plugin - 7 - 7 + 8 + 8 diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ComponentA.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ComponentA.java index 76fed073..3002cb36 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ComponentA.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ComponentA.java @@ -28,6 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.security.PermitAll; + // Used in DataAvailabilityTest @Ports({ @Port(name = "a", type = PortType.enforceable), @Port(name = "b", type = PortType.spontaneous) }) @@ -44,6 +46,7 @@ public ComponentA(int memoryLimit) { this.memoryLimit = memoryLimit; } + @PermitAll @Transition(name = "a", source = "zero", target = "zero", guard = "hasCapacity") public void enforceableOfA(@Data(name = "memoryUsage") Integer deltaMemory) { currentCapacity += deltaMemory; diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/PResizableBehaviorComponent.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/PResizableBehaviorComponent.java index 47efd6e3..c8503ba2 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/PResizableBehaviorComponent.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/PResizableBehaviorComponent.java @@ -86,13 +86,13 @@ public BehaviourBuilder initializeBehavior(int size) throws NoSuchMethodExceptio behaviourBuilder.addState("state" + (i + 1)); behaviourBuilder.addTransitionAndStates("p", "state" + (i), "state" + (i + 1), "isPEnabled", - PResizableBehaviorComponent.class.getMethod("enforceableP")); + "", "", PResizableBehaviorComponent.class.getMethod("enforceableP")); behaviourBuilder.addTransitionAndStates("sr", "state" + (i + 1), "state" + (i), "", - PResizableBehaviorComponent.class.getMethod("rollbackP")); + "", "", PResizableBehaviorComponent.class.getMethod("rollbackP")); behaviourBuilder.addTransitionAndStates("se", "state" + (i), "state" + (i), "", - PResizableBehaviorComponent.class.getMethod("enableP")); + "", "", PResizableBehaviorComponent.class.getMethod("enableP")); } diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteExecutableBehavior.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteExecutableBehavior.java index 929e6ee2..e5fa5643 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteExecutableBehavior.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/SwitchableRouteExecutableBehavior.java @@ -57,15 +57,15 @@ public BehaviourBuilder getExecutableBehavior() throws NoSuchMethodException { behaviourBuilder.addPort("finished", PortType.enforceable, this.getClass()); behaviourBuilder.addTransitionAndStates("on", "off", "on", "", - SwitchableRouteExecutableBehavior.class.getMethod("startRoute")); + "", "", SwitchableRouteExecutableBehavior.class.getMethod("startRoute")); behaviourBuilder.addTransitionAndStates("off", "on", "wait", "", - SwitchableRouteExecutableBehavior.class.getMethod("stopRoute")); + "", "", SwitchableRouteExecutableBehavior.class.getMethod("stopRoute")); behaviourBuilder.addTransitionAndStates("end", "wait", "done", "!isFinished", - SwitchableRouteExecutableBehavior.class.getMethod("spontaneousEnd")); + "", "", SwitchableRouteExecutableBehavior.class.getMethod("spontaneousEnd")); behaviourBuilder.addTransitionAndStates("", "wait", "done", "isFinished", - SwitchableRouteExecutableBehavior.class.getMethod("internalEnd")); + "", "", SwitchableRouteExecutableBehavior.class.getMethod("internalEnd")); behaviourBuilder.addTransitionAndStates("finished", "done", "off", "", - SwitchableRouteExecutableBehavior.class.getMethod("finishedTransition")); + "", "", SwitchableRouteExecutableBehavior.class.getMethod("finishedTransition")); // [off, on, wait, done] diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiMonitor.java index 2aeb355b..cb94366d 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiMonitor.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiMonitor.java @@ -95,17 +95,17 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { // ExecutorTransition=(name = on, source = off -> target = on, guard = , method = public void // org.bip.spec.SwitchableRoute.startRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ab", "state-AB", "state-AC", "", - HanoiMonitor.class.getMethod("moveAB")); + "", "", HanoiMonitor.class.getMethod("moveAB")); // ExecutorTransition=(name = off, source = on -> target = wait, guard = , method = public void // org.bip.spec.SwitchableRoute.stopRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ac", "state-AC", "state-BC", "", - HanoiMonitor.class.getMethod("moveAC")); + "", "", HanoiMonitor.class.getMethod("moveAC")); // ExecutorTransition=(name = end, source = wait -> target = done, guard = !isFinished, method = public void // org.bip.spec.SwitchableRoute.spontaneousEnd() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("bc", "state-BC", "state-AB", "", - HanoiMonitor.class.getMethod("moveBC")); + "", "", HanoiMonitor.class.getMethod("moveBC")); } else { @@ -121,17 +121,17 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { // ExecutorTransition=(name = off, source = on -> target = wait, guard = , method = public void // org.bip.spec.SwitchableRoute.stopRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ac", "state-AC", "state-AB", "", - HanoiMonitor.class.getMethod("moveAC")); + "", "", HanoiMonitor.class.getMethod("moveAC")); // ExecutorTransition=(name = on, source = off -> target = on, guard = , method = public void // org.bip.spec.SwitchableRoute.startRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ab", "state-AB", "state-BC", "", - HanoiMonitor.class.getMethod("moveAB")); + "", "", HanoiMonitor.class.getMethod("moveAB")); // ExecutorTransition=(name = end, source = wait -> target = done, guard = !isFinished, method = public void // org.bip.spec.SwitchableRoute.spontaneousEnd() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("bc", "state-BC", "state-AC", "", - HanoiMonitor.class.getMethod("moveBC")); + "", "", HanoiMonitor.class.getMethod("moveBC")); } diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiOptimalMonitor.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiOptimalMonitor.java index 050c4f46..6dcd025d 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiOptimalMonitor.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiOptimalMonitor.java @@ -95,17 +95,17 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { // ExecutorTransition=(name = on, source = off -> target = on, guard = , method = public void // org.bip.spec.SwitchableRoute.startRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ab", "state-AB", "state-AC", "", - HanoiOptimalMonitor.class.getMethod("moveAB")); + "", "", HanoiOptimalMonitor.class.getMethod("moveAB")); // ExecutorTransition=(name = off, source = on -> target = wait, guard = , method = public void // org.bip.spec.SwitchableRoute.stopRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ac", "state-AC", "state-BC", "", - HanoiOptimalMonitor.class.getMethod("moveAC")); + "", "", HanoiOptimalMonitor.class.getMethod("moveAC")); // ExecutorTransition=(name = end, source = wait -> target = done, guard = !isFinished, method = public void // org.bip.spec.SwitchableRoute.spontaneousEnd() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("bc", "state-BC", "state-AB", "", - HanoiOptimalMonitor.class.getMethod("moveBC")); + "", "", HanoiOptimalMonitor.class.getMethod("moveBC")); } else { @@ -121,17 +121,17 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { // ExecutorTransition=(name = off, source = on -> target = wait, guard = , method = public void // org.bip.spec.SwitchableRoute.stopRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ac", "state-AC", "state-AB", "", - HanoiOptimalMonitor.class.getMethod("moveAC")); + "", "", HanoiOptimalMonitor.class.getMethod("moveAC")); // ExecutorTransition=(name = on, source = off -> target = on, guard = , method = public void // org.bip.spec.SwitchableRoute.startRoute() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("ab", "state-AB", "state-BC", "", - HanoiOptimalMonitor.class.getMethod("moveAB")); + "", "", HanoiOptimalMonitor.class.getMethod("moveAB")); // ExecutorTransition=(name = end, source = wait -> target = done, guard = !isFinished, method = public void // org.bip.spec.SwitchableRoute.spontaneousEnd() throws java.lang.Exception), behaviourBuilder.addTransitionAndStates("bc", "state-BC", "state-AC", "", - HanoiOptimalMonitor.class.getMethod("moveBC")); + "", "", HanoiOptimalMonitor.class.getMethod("moveBC")); } diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPeg.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPeg.java index 7db4ae35..5ec40728 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPeg.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPeg.java @@ -72,9 +72,9 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { behaviourBuilder.addPort("piece" + (i + 1) + "Add", PortType.enforceable, this.getClass()); behaviourBuilder.addPort("piece" + (i + 1) + "Remove", PortType.enforceable, this.getClass()); behaviourBuilder.addTransitionAndStates("piece" + (i + 1) + "Add", "start", "start", "isPiece" + (i + 1) - + "Addable", this.getClass().getMethod("movePiece" + (i + 1))); + + "Addable", "", "", this.getClass().getMethod("movePiece" + (i + 1))); behaviourBuilder.addTransitionAndStates("piece" + (i + 1) + "Remove", "start", "start", "isPiece" + (i + 1) - + "Removable", this.getClass().getMethod("movePiece" + (i + 1))); + + "Removable", "", "", this.getClass().getMethod("movePiece" + (i + 1))); behaviourBuilder.addGuard("isPiece" + (i + 1) + "Addable", this.getClass().getMethod("isPiece" + (i + 1) + "Addable")); behaviourBuilder.addGuard("isPiece" + (i + 1) + "Removable", diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPegWithData.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPegWithData.java index cd69d7a0..e732801a 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPegWithData.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/hanoi/HanoiPegWithData.java @@ -76,10 +76,10 @@ public BehaviourBuilder initializeBehavior() throws NoSuchMethodException { // TRANSITIONS - behaviourBuilder.addTransitionAndStates("pieceAdd", initialState, initialState, "isPieceAddable", this + behaviourBuilder.addTransitionAndStates("pieceAdd", initialState, initialState, "isPieceAddable", "", "", this .getClass().getMethod("addPiece", int.class)); - behaviourBuilder.addTransitionAndStates("pieceRemove", initialState, initialState, "isPieceRemovable", this + behaviourBuilder.addTransitionAndStates("pieceRemove", initialState, initialState, "isPieceRemovable", "", "", this .getClass().getMethod("removePiece")); // GUARDS From 77797dbcd5bb4e97e8bb6df7e03fb8a993c45810 Mon Sep 17 00:00:00 2001 From: lsafina Date: Sun, 21 Aug 2022 17:36:59 +0200 Subject: [PATCH 12/19] java expression ast for using in invariant checking --- .../verification/ast/AfterDotExpression.java | 3 + .../verification/ast/ArrayExpression.java | 37 + .../verification/ast/BinaryExpression.java | 38 + .../verification/ast/BitBinaryExpression.java | 23 + .../verification/ast/BooleanExpression.java | 27 + .../ast/DotSeparatedExpression.java | 36 + .../verification/ast/EqualityExpression.java | 37 + .../verification/ast/FloatExpression.java | 38 + .../ast/IdentifierExpression.java | 37 + .../verification/ast/IntegerExpression.java | 38 + .../org/javabip/verification/ast/Literal.java | 3 + .../verification/ast/LogicalExpression.java | 37 + .../verification/ast/MethodCallBase.java | 3 + .../ast/MethodCallExpression.java | 58 + .../verification/ast/NullExpression.java | 21 + .../verification/ast/NumericLiteral.java | 3 + .../ast/ParsedJavaExpression.java | 9 + .../verification/ast/PostfixExpression.java | 39 + .../verification/ast/PrefixExpression.java | 37 + .../verification/ast/ProductExpression.java | 41 + .../ast/RelationalExpression.java | 44 + .../verification/ast/StringExpression.java | 25 + .../verification/ast/SumExpression.java | 56 + .../verification/ast/SuperExpression.java | 29 + .../verification/ast/TernaryExpression.java | 43 + .../verification/ast/ThisExpression.java | 22 + .../verification/ast/UnaryExpression.java | 3 + .../org/javabip/verification/ast/Utils.java | 12 + .../javabip/verification/parser/JavaLexer.g4 | 241 +++ .../verification/parser/JavaLexer.interp | 408 ++++++ .../verification/parser/JavaLexer.java | 581 ++++++++ .../verification/parser/JavaLexer.tokens | 242 +++ .../javabip/verification/parser/JavaParser.g4 | 815 +++++++++++ .../verification/parser/JavaParser.interp | 275 ++++ .../verification/parser/JavaParser.java | 1304 +++++++++++++++++ .../verification/parser/JavaParser.tokens | 242 +++ .../parser/JavaParserBaseListener.java | 135 ++ .../parser/JavaParserBaseVisitor.java | 70 + .../parser/JavaParserListener.java | 90 ++ .../parser/JavaParserVisitor.java | 61 + .../visitors/ExpressionASTBuilder.java | 332 +++++ .../visitors/PJEEvaluateNumericVisitor.java | 70 + .../visitors/PJEEvaluateVisitor.java | 67 + .../verification/visitors/PJEVisitor.java | 26 + .../visitors/PJEWellformednessChecker.java | 66 + .../test/PJEEvaluateNumericVisitorTest.java | 167 +++ .../visitors/test/PJEEvaluateVisitorTest.java | 238 +++ .../ParsedJavaExpressionASTBuilderTest.java | 203 +++ 48 files changed, 6432 insertions(+) create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/AfterDotExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/BinaryExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/Literal.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallBase.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/NumericLiteral.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/UnaryExpression.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/Utils.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.interp create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.tokens create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.interp create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.tokens create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseListener.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserListener.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEWellformednessChecker.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/AfterDotExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/AfterDotExpression.java new file mode 100644 index 00000000..cfdd6d3c --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/AfterDotExpression.java @@ -0,0 +1,3 @@ +package org.javabip.verification.ast; + +public interface AfterDotExpression extends ParsedJavaExpression {} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java new file mode 100644 index 00000000..f0f0d821 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java @@ -0,0 +1,37 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +// for expressions like expression[expression] +public class ArrayExpression implements ParsedJavaExpression { + final ParsedJavaExpression outerExpression; + final ParsedJavaExpression innerExpression; + + public ArrayExpression(ParsedJavaExpression array, ParsedJavaExpression value) { + this.outerExpression = array; + this.innerExpression = value; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + public String toString(){ + return outerExpression.toString() + "[" + innerExpression.toString() + "]"; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + //could be: a[i] + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/BinaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/BinaryExpression.java new file mode 100644 index 00000000..a2e6505c --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/BinaryExpression.java @@ -0,0 +1,38 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEVisitor; + +abstract class BinaryExpression implements ParsedJavaExpression { + public ParsedJavaExpression leftExpression; + public ParsedJavaExpression rightExpression; + public String separator; + //public Set separators; + + public BinaryExpression(ParsedJavaExpression leftExpression, ParsedJavaExpression rightExpression, String separator) { + this.leftExpression = leftExpression; + this.rightExpression = rightExpression; + this.separator = separator; + } + + public String toString(){ + return leftExpression.toString() + separator + rightExpression.toString(); + } + + /*public boolean inSeparators(String s) { + return separators.contains(s); + }*/ + + /*public BinaryExpression(Expression leftExpression, Expression rightExpression, String separator) { + this.leftExpression = leftExpression; + this.rightExpression = rightExpression; + this.separator = separator; + }*/ + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + boolean evaluateL = leftExpression.evaluate(componentClass, bipComponent); + boolean evaluateR = rightExpression.evaluate(componentClass, bipComponent); + + return false; + }*/ +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java new file mode 100644 index 00000000..5fb371a2 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java @@ -0,0 +1,23 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class BitBinaryExpression extends BinaryExpression implements ParsedJavaExpression { + public BitBinaryExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ + super(left, right, separator); + //separators = new HashSet(){{add("<<");add(">>"); add(">>>");add("&");add("^");add("|");}}; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + //could be + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java new file mode 100644 index 00000000..e54c18f9 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java @@ -0,0 +1,27 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class BooleanExpression implements Literal { + public Boolean value; + + public BooleanExpression(Boolean value) { + this.value = value; + } + + public String toString(){ + return value.toString(); + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return value; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + //TODO either return null or some "ErrorExpression" + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java new file mode 100644 index 00000000..1ac37dfa --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java @@ -0,0 +1,36 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class DotSeparatedExpression implements ParsedJavaExpression { + final ParsedJavaExpression left; + final AfterDotExpression right; + + public DotSeparatedExpression(ParsedJavaExpression left, AfterDotExpression right) { + this.left = left; + this.right = right; + } + + public String toString(){ + return left.toString() + "." + right.toString(); + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java new file mode 100644 index 00000000..3a085b7d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java @@ -0,0 +1,37 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class EqualityExpression extends BinaryExpression implements ParsedJavaExpression { + public EqualityExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ + super(left, right, separator); + //separators = new HashSet(){{add("!=");add("==");}}; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + Object left = leftExpression.accept(v); + Object right = rightExpression.accept(v); + + switch (separator) { + case "!=": + return left != right; + case "==": { + if (left == null){ + return right == null; + } else return left.equals(right); + } + + default: { + //TODO throw exception + return null; + } + } + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java new file mode 100644 index 00000000..bab75a20 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java @@ -0,0 +1,38 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class FloatExpression implements NumericLiteral { + public Float value; + public FloatType floatType; + + public FloatExpression(Float value, FloatType floatType) { + this.value = value; + this.floatType = floatType; + } + + @Override + public Double accept(PJEEvaluateVisitor v) { + return value.doubleValue(); + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + public enum FloatType { FLOAT, HEX_FLOAT } + + public String toString(){ + return value.toString(); + } + + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java new file mode 100644 index 00000000..c33b649f --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java @@ -0,0 +1,37 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class IdentifierExpression implements ParsedJavaExpression, AfterDotExpression, MethodCallBase { + final String identifierName; + + public String getIdentifierName() { + return identifierName; + } + + public IdentifierExpression(String identifierName) { + this.identifierName = identifierName; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //nothing to do here + return true; + }*/ + + public String toString(){ + return identifierName; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java new file mode 100644 index 00000000..74408f30 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java @@ -0,0 +1,38 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class IntegerExpression implements NumericLiteral { + public Integer value; + public IntegerType integerType; + + public IntegerExpression(Integer value, IntegerType integerType) { + this.value = value; + this.integerType = integerType; + } + + @Override + public Double accept(PJEEvaluateVisitor v) { + return value.doubleValue(); + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + public enum IntegerType { DECIMAL_LITERAL, HEX_LITERAL, OCT_LITERAL, BINARY_LITERAL } + + public String toString(){ + return value.toString(); + } + + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/Literal.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/Literal.java new file mode 100644 index 00000000..da98cd0d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/Literal.java @@ -0,0 +1,3 @@ +package org.javabip.verification.ast; + +public interface Literal extends ParsedJavaExpression {} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java new file mode 100644 index 00000000..3a4463ef --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java @@ -0,0 +1,37 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class LogicalExpression extends BinaryExpression implements ParsedJavaExpression { + public LogicalExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ + super(left, right, separator); + //separators = new HashSet(){{add("&&");add("||");}}; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + try { + Boolean left = (Boolean) leftExpression.accept(v); + Boolean right = (Boolean) rightExpression.accept(v); + + switch (separator) { + case "||": return left || right; + case "&&": return left && right; + + default: { + //TODO raise exception + return null; + } + } + } catch (ClassCastException e){ + //TODO process exception + } + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallBase.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallBase.java new file mode 100644 index 00000000..0ed780d4 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallBase.java @@ -0,0 +1,3 @@ +package org.javabip.verification.ast; + +public interface MethodCallBase {} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java new file mode 100644 index 00000000..1e7f0683 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java @@ -0,0 +1,58 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +import java.util.ArrayList; + +public class MethodCallExpression implements ParsedJavaExpression, AfterDotExpression { + MethodCallBase methodCallBase; + ArrayList arguments; + + public MethodCallExpression(MethodCallBase methodCallBase, ArrayList arguments) { + this.methodCallBase = methodCallBase; + this.arguments = arguments; + } + + + Boolean isThis(){ + return methodCallBase instanceof ThisExpression; + } + + Boolean isSuper(){ + return methodCallBase instanceof SuperExpression; + } + + Boolean isIdentifier(){ + return methodCallBase instanceof IdentifierExpression; + } + + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + public String toString(){ + StringBuilder sb = new StringBuilder(); + sb.append(methodCallBase.toString()).append("("); + arguments.forEach(a -> sb.append(a.toString()).append(", ")); + int length = sb.length(); + if (arguments.size()>0) sb.delete(length -2, length); + sb.append(")"); + return sb.toString(); + } + + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java new file mode 100644 index 00000000..391803c5 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java @@ -0,0 +1,21 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class NullExpression implements Literal, ParsedJavaExpression { + public String toString(){ + return "null"; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/NumericLiteral.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/NumericLiteral.java new file mode 100644 index 00000000..3140d274 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/NumericLiteral.java @@ -0,0 +1,3 @@ +package org.javabip.verification.ast; + +public interface NumericLiteral extends Literal{} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java new file mode 100644 index 00000000..b7b98bb4 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java @@ -0,0 +1,9 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public interface ParsedJavaExpression { + Object accept(PJEEvaluateVisitor v); + Number accept(PJEEvaluateNumericVisitor v); +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java new file mode 100644 index 00000000..87bf9f74 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java @@ -0,0 +1,39 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class PostfixExpression implements UnaryExpression, ParsedJavaExpression { + final ParsedJavaExpression expression; + final String postfix; + + public PostfixExpression(ParsedJavaExpression expression, String postfix) { + this.expression = expression; + this.postfix = postfix; + } + + public String toString(){ + return expression.toString() + postfix; + } + + //Set postfixes = new HashSet(){{add("-");add("+"); add("++");add("--");add("~");add("!");}}; + + //boolean inPostfixes(String postfix){return postfixes.contains(postfix);} + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java new file mode 100644 index 00000000..01414a9b --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java @@ -0,0 +1,37 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class PrefixExpression implements ParsedJavaExpression { + final ParsedJavaExpression expression; + final String prefix; + + public PrefixExpression(ParsedJavaExpression expression, String prefix) { + this.expression = expression; + this.prefix = prefix; + } + + public String toString(){ + return prefix + expression.toString(); + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + //Set prefixes = new HashSet(){{add("--");add("++");}}; + //boolean inPrefixes(String prefix){return prefixes.contains(prefix);} + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java new file mode 100644 index 00000000..a7449a0f --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java @@ -0,0 +1,41 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class ProductExpression extends BinaryExpression implements ParsedJavaExpression { + public ProductExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ + super(left, right, separator); + //separators = new HashSet(){{add("*");add("/");add("%");}}; + } + + @Override + public Double accept(PJEEvaluateVisitor v) { + try { + double left = ((Number) leftExpression.accept(v)).doubleValue(); + double right = ((Number) rightExpression.accept(v)).doubleValue(); + + switch (separator) { + case "*": return left * right; + case "/": { + if (right == 0) return null; //TODO exception? + return left / right; + } + case "%": return left % right; + + default: { + //TODO raise exception + return null; + } + } + } catch (ClassCastException e){ + //TODO process exception + } + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java new file mode 100644 index 00000000..b058e9d0 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java @@ -0,0 +1,44 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class RelationalExpression extends BinaryExpression implements ParsedJavaExpression { + public RelationalExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator) { + super(left, right, separator); + //separators = new HashSet(){{add("<=");add("=>");add("<");add(">");}}; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + //here we cast the result to double as a "base class" of a Number. However, if big values are expected, it should be changed to BigDecimal + + try { + double left = ((Number) leftExpression.accept(v)).doubleValue(); + double right = ((Number) rightExpression.accept(v)).doubleValue(); + + switch (separator) { + case ">": return left > right; + case "<": return left < right; + case ">=": return left >= right; + case "<=": return left <= right; + + default: { + //TODO raise exception + return null; + } + } + } catch (ClassCastException e){ + //TODO process exception + } + return null; + } + + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java new file mode 100644 index 00000000..e92df9af --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java @@ -0,0 +1,25 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +public class StringExpression implements Literal { + public String value; + public StringExpression(String value) { + this.value = value; + } + + public String toString(){ + return value; + } + + @Override + public String accept(PJEEvaluateVisitor v) { + return value; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java new file mode 100644 index 00000000..b89fe6e8 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java @@ -0,0 +1,56 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class SumExpression extends BinaryExpression implements ParsedJavaExpression { + public SumExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator) { + super(left, right, separator); + //separators = new HashSet(){{add("+");add("-");}}; + } + + + @Override + public Object accept(PJEEvaluateVisitor v) { + try { + Object left = leftExpression.accept(v); + Object right = rightExpression.accept(v); + + if (left instanceof String && right instanceof String) { + if (separator.equals("+")) + return left + (String) right; + else { + //TODO exception, malformed + return null; + } + } + + if (left instanceof Number && right instanceof Number) { + Double leftD = ((Number) left).doubleValue(); + Double rightD = ((Number) right).doubleValue(); + + switch (separator) { + case "+": + return leftD + rightD; + case "-": + return leftD - rightD; + + default: { + //TODO raise exception + return null; + } + } + } + } catch (ClassCastException e) { + //TODO process exception + } + + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java new file mode 100644 index 00000000..d994f7e1 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java @@ -0,0 +1,29 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class SuperExpression implements ParsedJavaExpression, MethodCallBase { + public String toString(){ + return "super"; + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java new file mode 100644 index 00000000..44706557 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java @@ -0,0 +1,43 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class TernaryExpression implements ParsedJavaExpression { + final ParsedJavaExpression condition; + final ParsedJavaExpression trueExpression; + final ParsedJavaExpression falseExpression; + + public TernaryExpression(ParsedJavaExpression condition, ParsedJavaExpression trueExpression, ParsedJavaExpression falseExpression) { + this.condition = condition; + this.trueExpression = trueExpression; + this.falseExpression = falseExpression; + } + + public String toString(){ + return condition.toString() + + " ? " + + trueExpression.toString() + + " : " + + falseExpression.toString(); + } + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } + + /*@Override + public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { + //TODO not implemented + return false; + }*/ + + +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java new file mode 100644 index 00000000..93cab90a --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java @@ -0,0 +1,22 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.javabip.verification.visitors.PJEVisitor; + +public class ThisExpression implements ParsedJavaExpression, AfterDotExpression, MethodCallBase { + public String toString(){ + return "this"; + } + + + @Override + public Boolean accept(PJEEvaluateVisitor v) { + return null; + } + + @Override + public Number accept(PJEEvaluateNumericVisitor v) { + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/UnaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/UnaryExpression.java new file mode 100644 index 00000000..cba54e3e --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/UnaryExpression.java @@ -0,0 +1,3 @@ +package org.javabip.verification.ast; + +public interface UnaryExpression extends ParsedJavaExpression {} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/Utils.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/Utils.java new file mode 100644 index 00000000..78a864d6 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/Utils.java @@ -0,0 +1,12 @@ +package org.javabip.verification.ast; + +import java.util.HashSet; +import java.util.Set; + +public final class Utils { + static Set postfixes = new HashSet(){{add("-");add("+"); add("++");add("--");add("~");add("!");}}; + static Set prefixes = new HashSet(){{add("--");add("++");add("!");add("~");}}; + + public boolean inPrefixes(String prefix){return prefixes.contains(prefix);} + public boolean inPostfixes(String postfix){return postfixes.contains(postfix);} +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 new file mode 100644 index 00000000..9cc40772 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 @@ -0,0 +1,241 @@ +/* + [The "BSD licence"] + Copyright (c) 2013 Terence Parr, Sam Harwell + Copyright (c) 2017 Ivan Kochurkin (upgrade to Java 8) + Copyright (c) 2021 Michał Lorek (upgrade to Java 11) + Copyright (c) 2022 Michał Lorek (upgrade to Java 17) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +lexer grammar JavaLexer; + +// Keywords + +ABSTRACT: 'abstract'; +ASSERT: 'assert'; +BOOLEAN: 'boolean'; +BREAK: 'break'; +BYTE: 'byte'; +CASE: 'case'; +CATCH: 'catch'; +CHAR: 'char'; +CLASS: 'class'; +CONST: 'const'; +CONTINUE: 'continue'; +DEFAULT: 'default'; +DO: 'do'; +DOUBLE: 'double'; +ELSE: 'else'; +ENUM: 'enum'; +EXTENDS: 'extends'; +FINAL: 'final'; +FINALLY: 'finally'; +FLOAT: 'float'; +FOR: 'for'; +IF: 'if'; +GOTO: 'goto'; +IMPLEMENTS: 'implements'; +IMPORT: 'import'; +INSTANCEOF: 'instanceof'; +INT: 'int'; +INTERFACE: 'interface'; +LONG: 'long'; +NATIVE: 'native'; +NEW: 'new'; +PACKAGE: 'package'; +PRIVATE: 'private'; +PROTECTED: 'protected'; +PUBLIC: 'public'; +RETURN: 'return'; +SHORT: 'short'; +STATIC: 'static'; +STRICTFP: 'strictfp'; +SUPER: 'super'; +SWITCH: 'switch'; +SYNCHRONIZED: 'synchronized'; +THIS: 'this'; +THROW: 'throw'; +THROWS: 'throws'; +TRANSIENT: 'transient'; +TRY: 'try'; +VOID: 'void'; +VOLATILE: 'volatile'; +WHILE: 'while'; + +// Module related keywords +MODULE: 'module'; +OPEN: 'open'; +REQUIRES: 'requires'; +EXPORTS: 'exports'; +OPENS: 'opens'; +TO: 'to'; +USES: 'uses'; +PROVIDES: 'provides'; +WITH: 'with'; +TRANSITIVE: 'transitive'; + +// Local Variable Type Inference +VAR: 'var'; // reserved type name + +// Switch Expressions +YIELD: 'yield'; + +// Records +RECORD: 'record'; + +// Sealed Classes +SEALED: 'sealed'; +PERMITS: 'permits'; +NON_SEALED: 'non-sealed'; + +// Literals + +DECIMAL_LITERAL: ('0' | [1-9] (Digits? | '_'+ Digits)) [lL]?; +HEX_LITERAL: '0' [xX] [0-9a-fA-F] ([0-9a-fA-F_]* [0-9a-fA-F])? [lL]?; +OCT_LITERAL: '0' '_'* [0-7] ([0-7_]* [0-7])? [lL]?; +BINARY_LITERAL: '0' [bB] [01] ([01_]* [01])? [lL]?; + +FLOAT_LITERAL: (Digits '.' Digits? | '.' Digits) ExponentPart? [fFdD]? + | Digits (ExponentPart [fFdD]? | [fFdD]) + ; + +HEX_FLOAT_LITERAL: '0' [xX] (HexDigits '.'? | HexDigits? '.' HexDigits) [pP] [+-]? Digits [fFdD]?; + +BOOL_LITERAL: 'true' + | 'false' + ; + +CHAR_LITERAL: '\'' (~['\\\r\n] | EscapeSequence) '\''; + +STRING_LITERAL: '"' (~["\\\r\n] | EscapeSequence)* '"'; + +TEXT_BLOCK: '"""' [ \t]* [\r\n] (. | EscapeSequence)*? '"""'; + +NULL_LITERAL: 'null'; + +// Separators + +LPAREN: '('; +RPAREN: ')'; +LBRACE: '{'; +RBRACE: '}'; +LBRACK: '['; +RBRACK: ']'; +SEMI: ';'; +COMMA: ','; +DOT: '.'; + +// Operators + +ASSIGN: '='; +GT: '>'; +LT: '<'; +BANG: '!'; +TILDE: '~'; +QUESTION: '?'; +COLON: ':'; +EQUAL: '=='; +LE: '<='; +GE: '>='; +NOTEQUAL: '!='; +AND: '&&'; +OR: '||'; +INC: '++'; +DEC: '--'; +ADD: '+'; +SUB: '-'; +MUL: '*'; +DIV: '/'; +BITAND: '&'; +BITOR: '|'; +CARET: '^'; +MOD: '%'; + +ADD_ASSIGN: '+='; +SUB_ASSIGN: '-='; +MUL_ASSIGN: '*='; +DIV_ASSIGN: '/='; +AND_ASSIGN: '&='; +OR_ASSIGN: '|='; +XOR_ASSIGN: '^='; +MOD_ASSIGN: '%='; +LSHIFT_ASSIGN: '<<='; +RSHIFT_ASSIGN: '>>='; +URSHIFT_ASSIGN: '>>>='; + +// Java 8 tokens + +ARROW: '->'; +COLONCOLON: '::'; + +// Additional symbols not defined in the lexical specification + +AT: '@'; +ELLIPSIS: '...'; + +// Whitespace and comments + +WS: [ \t\r\n\u000C]+ -> channel(HIDDEN); +COMMENT: '/*' .*? '*/' -> channel(HIDDEN); +LINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN); + +// Identifiers + +IDENTIFIER: Letter LetterOrDigit*; + +// Fragment rules + +fragment ExponentPart + : [eE] [+-]? Digits + ; + +fragment EscapeSequence + : '\\' [btnfr"'\\] + | '\\' ([0-3]? [0-7])? [0-7] + | '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit + ; + +fragment HexDigits + : HexDigit ((HexDigit | '_')* HexDigit)? + ; + +fragment HexDigit + : [0-9a-fA-F] + ; + +fragment Digits + : [0-9] ([0-9_]* [0-9])? + ; + +fragment LetterOrDigit + : Letter + | [0-9] + ; + +fragment Letter + : [a-zA-Z$_] // these are the "java letters" below 0x7F + | ~[\u0000-\u007F\uD800-\uDBFF] // covers all characters above 0x7F which are not a surrogate + | [\uD800-\uDBFF] [\uDC00-\uDFFF] // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF + ; \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.interp b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.interp new file mode 100644 index 00000000..18e0f528 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.interp @@ -0,0 +1,408 @@ +token literal names: +null +'abstract' +'assert' +'boolean' +'break' +'byte' +'case' +'catch' +'char' +'class' +'const' +'continue' +'default' +'do' +'double' +'else' +'enum' +'extends' +'final' +'finally' +'float' +'for' +'if' +'goto' +'implements' +'import' +'instanceof' +'int' +'interface' +'long' +'native' +'new' +'package' +'private' +'protected' +'public' +'return' +'short' +'static' +'strictfp' +'super' +'switch' +'synchronized' +'this' +'throw' +'throws' +'transient' +'try' +'void' +'volatile' +'while' +'module' +'open' +'requires' +'exports' +'opens' +'to' +'uses' +'provides' +'with' +'transitive' +'var' +'yield' +'record' +'sealed' +'permits' +'non-sealed' +null +null +null +null +null +null +null +null +null +null +'null' +'(' +')' +'{' +'}' +'[' +']' +';' +',' +'.' +'=' +'>' +'<' +'!' +'~' +'?' +':' +'==' +'<=' +'>=' +'!=' +'&&' +'||' +'++' +'--' +'+' +'-' +'*' +'/' +'&' +'|' +'^' +'%' +'+=' +'-=' +'*=' +'/=' +'&=' +'|=' +'^=' +'%=' +'<<=' +'>>=' +'>>>=' +'->' +'::' +'@' +'...' +null +null +null +null + +token symbolic names: +null +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER + +rule names: +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER +ExponentPart +EscapeSequence +HexDigits +HexDigit +Digits +LetterOrDigit +Letter + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 130, 1114, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 4, 120, 9, 120, 4, 121, 9, 121, 4, 122, 9, 122, 4, 123, 9, 123, 4, 124, 9, 124, 4, 125, 9, 125, 4, 126, 9, 126, 4, 127, 9, 127, 4, 128, 9, 128, 4, 129, 9, 129, 4, 130, 9, 130, 4, 131, 9, 131, 4, 132, 9, 132, 4, 133, 9, 133, 4, 134, 9, 134, 4, 135, 9, 135, 4, 136, 9, 136, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 5, 68, 727, 10, 68, 3, 68, 6, 68, 730, 10, 68, 13, 68, 14, 68, 731, 3, 68, 5, 68, 735, 10, 68, 5, 68, 737, 10, 68, 3, 68, 5, 68, 740, 10, 68, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 746, 10, 69, 12, 69, 14, 69, 749, 11, 69, 3, 69, 5, 69, 752, 10, 69, 3, 69, 5, 69, 755, 10, 69, 3, 70, 3, 70, 7, 70, 759, 10, 70, 12, 70, 14, 70, 762, 11, 70, 3, 70, 3, 70, 7, 70, 766, 10, 70, 12, 70, 14, 70, 769, 11, 70, 3, 70, 5, 70, 772, 10, 70, 3, 70, 5, 70, 775, 10, 70, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 781, 10, 71, 12, 71, 14, 71, 784, 11, 71, 3, 71, 5, 71, 787, 10, 71, 3, 71, 5, 71, 790, 10, 71, 3, 72, 3, 72, 3, 72, 5, 72, 795, 10, 72, 3, 72, 3, 72, 5, 72, 799, 10, 72, 3, 72, 5, 72, 802, 10, 72, 3, 72, 5, 72, 805, 10, 72, 3, 72, 3, 72, 3, 72, 5, 72, 810, 10, 72, 3, 72, 5, 72, 813, 10, 72, 5, 72, 815, 10, 72, 3, 73, 3, 73, 3, 73, 3, 73, 5, 73, 821, 10, 73, 3, 73, 5, 73, 824, 10, 73, 3, 73, 3, 73, 5, 73, 828, 10, 73, 3, 73, 3, 73, 5, 73, 832, 10, 73, 3, 73, 3, 73, 5, 73, 836, 10, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 847, 10, 74, 3, 75, 3, 75, 3, 75, 5, 75, 852, 10, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 7, 76, 859, 10, 76, 12, 76, 14, 76, 862, 11, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 871, 10, 77, 12, 77, 14, 77, 874, 11, 77, 3, 77, 3, 77, 3, 77, 7, 77, 879, 10, 77, 12, 77, 14, 77, 882, 11, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 3, 93, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 104, 3, 104, 3, 105, 3, 105, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 113, 3, 113, 3, 113, 3, 114, 3, 114, 3, 114, 3, 115, 3, 115, 3, 115, 3, 116, 3, 116, 3, 116, 3, 117, 3, 117, 3, 117, 3, 118, 3, 118, 3, 118, 3, 119, 3, 119, 3, 119, 3, 119, 3, 120, 3, 120, 3, 120, 3, 120, 3, 121, 3, 121, 3, 121, 3, 121, 3, 121, 3, 122, 3, 122, 3, 122, 3, 123, 3, 123, 3, 123, 3, 124, 3, 124, 3, 125, 3, 125, 3, 125, 3, 125, 3, 126, 6, 126, 1015, 10, 126, 13, 126, 14, 126, 1016, 3, 126, 3, 126, 3, 127, 3, 127, 3, 127, 3, 127, 7, 127, 1025, 10, 127, 12, 127, 14, 127, 1028, 11, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 128, 3, 128, 3, 128, 3, 128, 7, 128, 1039, 10, 128, 12, 128, 14, 128, 1042, 11, 128, 3, 128, 3, 128, 3, 129, 3, 129, 7, 129, 1048, 10, 129, 12, 129, 14, 129, 1051, 11, 129, 3, 130, 3, 130, 5, 130, 1055, 10, 130, 3, 130, 3, 130, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1063, 10, 131, 3, 131, 5, 131, 1066, 10, 131, 3, 131, 3, 131, 3, 131, 6, 131, 1071, 10, 131, 13, 131, 14, 131, 1072, 3, 131, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1080, 10, 131, 3, 132, 3, 132, 3, 132, 7, 132, 1085, 10, 132, 12, 132, 14, 132, 1088, 11, 132, 3, 132, 5, 132, 1091, 10, 132, 3, 133, 3, 133, 3, 134, 3, 134, 7, 134, 1097, 10, 134, 12, 134, 14, 134, 1100, 11, 134, 3, 134, 5, 134, 1103, 10, 134, 3, 135, 3, 135, 5, 135, 1107, 10, 135, 3, 136, 3, 136, 3, 136, 3, 136, 5, 136, 1113, 10, 136, 4, 880, 1026, 2, 137, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 75, 149, 76, 151, 77, 153, 78, 155, 79, 157, 80, 159, 81, 161, 82, 163, 83, 165, 84, 167, 85, 169, 86, 171, 87, 173, 88, 175, 89, 177, 90, 179, 91, 181, 92, 183, 93, 185, 94, 187, 95, 189, 96, 191, 97, 193, 98, 195, 99, 197, 100, 199, 101, 201, 102, 203, 103, 205, 104, 207, 105, 209, 106, 211, 107, 213, 108, 215, 109, 217, 110, 219, 111, 221, 112, 223, 113, 225, 114, 227, 115, 229, 116, 231, 117, 233, 118, 235, 119, 237, 120, 239, 121, 241, 122, 243, 123, 245, 124, 247, 125, 249, 126, 251, 127, 253, 128, 255, 129, 257, 130, 259, 2, 261, 2, 263, 2, 265, 2, 267, 2, 269, 2, 271, 2, 3, 2, 29, 3, 2, 51, 59, 4, 2, 78, 78, 110, 110, 4, 2, 90, 90, 122, 122, 5, 2, 50, 59, 67, 72, 99, 104, 6, 2, 50, 59, 67, 72, 97, 97, 99, 104, 3, 2, 50, 57, 4, 2, 50, 57, 97, 97, 4, 2, 68, 68, 100, 100, 3, 2, 50, 51, 4, 2, 50, 51, 97, 97, 6, 2, 70, 70, 72, 72, 102, 102, 104, 104, 4, 2, 82, 82, 114, 114, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 11, 11, 34, 34, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 71, 71, 103, 103, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97, 99, 124, 4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345, 2, 1158, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 2, 165, 3, 2, 2, 2, 2, 167, 3, 2, 2, 2, 2, 169, 3, 2, 2, 2, 2, 171, 3, 2, 2, 2, 2, 173, 3, 2, 2, 2, 2, 175, 3, 2, 2, 2, 2, 177, 3, 2, 2, 2, 2, 179, 3, 2, 2, 2, 2, 181, 3, 2, 2, 2, 2, 183, 3, 2, 2, 2, 2, 185, 3, 2, 2, 2, 2, 187, 3, 2, 2, 2, 2, 189, 3, 2, 2, 2, 2, 191, 3, 2, 2, 2, 2, 193, 3, 2, 2, 2, 2, 195, 3, 2, 2, 2, 2, 197, 3, 2, 2, 2, 2, 199, 3, 2, 2, 2, 2, 201, 3, 2, 2, 2, 2, 203, 3, 2, 2, 2, 2, 205, 3, 2, 2, 2, 2, 207, 3, 2, 2, 2, 2, 209, 3, 2, 2, 2, 2, 211, 3, 2, 2, 2, 2, 213, 3, 2, 2, 2, 2, 215, 3, 2, 2, 2, 2, 217, 3, 2, 2, 2, 2, 219, 3, 2, 2, 2, 2, 221, 3, 2, 2, 2, 2, 223, 3, 2, 2, 2, 2, 225, 3, 2, 2, 2, 2, 227, 3, 2, 2, 2, 2, 229, 3, 2, 2, 2, 2, 231, 3, 2, 2, 2, 2, 233, 3, 2, 2, 2, 2, 235, 3, 2, 2, 2, 2, 237, 3, 2, 2, 2, 2, 239, 3, 2, 2, 2, 2, 241, 3, 2, 2, 2, 2, 243, 3, 2, 2, 2, 2, 245, 3, 2, 2, 2, 2, 247, 3, 2, 2, 2, 2, 249, 3, 2, 2, 2, 2, 251, 3, 2, 2, 2, 2, 253, 3, 2, 2, 2, 2, 255, 3, 2, 2, 2, 2, 257, 3, 2, 2, 2, 3, 273, 3, 2, 2, 2, 5, 282, 3, 2, 2, 2, 7, 289, 3, 2, 2, 2, 9, 297, 3, 2, 2, 2, 11, 303, 3, 2, 2, 2, 13, 308, 3, 2, 2, 2, 15, 313, 3, 2, 2, 2, 17, 319, 3, 2, 2, 2, 19, 324, 3, 2, 2, 2, 21, 330, 3, 2, 2, 2, 23, 336, 3, 2, 2, 2, 25, 345, 3, 2, 2, 2, 27, 353, 3, 2, 2, 2, 29, 356, 3, 2, 2, 2, 31, 363, 3, 2, 2, 2, 33, 368, 3, 2, 2, 2, 35, 373, 3, 2, 2, 2, 37, 381, 3, 2, 2, 2, 39, 387, 3, 2, 2, 2, 41, 395, 3, 2, 2, 2, 43, 401, 3, 2, 2, 2, 45, 405, 3, 2, 2, 2, 47, 408, 3, 2, 2, 2, 49, 413, 3, 2, 2, 2, 51, 424, 3, 2, 2, 2, 53, 431, 3, 2, 2, 2, 55, 442, 3, 2, 2, 2, 57, 446, 3, 2, 2, 2, 59, 456, 3, 2, 2, 2, 61, 461, 3, 2, 2, 2, 63, 468, 3, 2, 2, 2, 65, 472, 3, 2, 2, 2, 67, 480, 3, 2, 2, 2, 69, 488, 3, 2, 2, 2, 71, 498, 3, 2, 2, 2, 73, 505, 3, 2, 2, 2, 75, 512, 3, 2, 2, 2, 77, 518, 3, 2, 2, 2, 79, 525, 3, 2, 2, 2, 81, 534, 3, 2, 2, 2, 83, 540, 3, 2, 2, 2, 85, 547, 3, 2, 2, 2, 87, 560, 3, 2, 2, 2, 89, 565, 3, 2, 2, 2, 91, 571, 3, 2, 2, 2, 93, 578, 3, 2, 2, 2, 95, 588, 3, 2, 2, 2, 97, 592, 3, 2, 2, 2, 99, 597, 3, 2, 2, 2, 101, 606, 3, 2, 2, 2, 103, 612, 3, 2, 2, 2, 105, 619, 3, 2, 2, 2, 107, 624, 3, 2, 2, 2, 109, 633, 3, 2, 2, 2, 111, 641, 3, 2, 2, 2, 113, 647, 3, 2, 2, 2, 115, 650, 3, 2, 2, 2, 117, 655, 3, 2, 2, 2, 119, 664, 3, 2, 2, 2, 121, 669, 3, 2, 2, 2, 123, 680, 3, 2, 2, 2, 125, 684, 3, 2, 2, 2, 127, 690, 3, 2, 2, 2, 129, 697, 3, 2, 2, 2, 131, 704, 3, 2, 2, 2, 133, 712, 3, 2, 2, 2, 135, 736, 3, 2, 2, 2, 137, 741, 3, 2, 2, 2, 139, 756, 3, 2, 2, 2, 141, 776, 3, 2, 2, 2, 143, 814, 3, 2, 2, 2, 145, 816, 3, 2, 2, 2, 147, 846, 3, 2, 2, 2, 149, 848, 3, 2, 2, 2, 151, 855, 3, 2, 2, 2, 153, 865, 3, 2, 2, 2, 155, 887, 3, 2, 2, 2, 157, 892, 3, 2, 2, 2, 159, 894, 3, 2, 2, 2, 161, 896, 3, 2, 2, 2, 163, 898, 3, 2, 2, 2, 165, 900, 3, 2, 2, 2, 167, 902, 3, 2, 2, 2, 169, 904, 3, 2, 2, 2, 171, 906, 3, 2, 2, 2, 173, 908, 3, 2, 2, 2, 175, 910, 3, 2, 2, 2, 177, 912, 3, 2, 2, 2, 179, 914, 3, 2, 2, 2, 181, 916, 3, 2, 2, 2, 183, 918, 3, 2, 2, 2, 185, 920, 3, 2, 2, 2, 187, 922, 3, 2, 2, 2, 189, 924, 3, 2, 2, 2, 191, 927, 3, 2, 2, 2, 193, 930, 3, 2, 2, 2, 195, 933, 3, 2, 2, 2, 197, 936, 3, 2, 2, 2, 199, 939, 3, 2, 2, 2, 201, 942, 3, 2, 2, 2, 203, 945, 3, 2, 2, 2, 205, 948, 3, 2, 2, 2, 207, 950, 3, 2, 2, 2, 209, 952, 3, 2, 2, 2, 211, 954, 3, 2, 2, 2, 213, 956, 3, 2, 2, 2, 215, 958, 3, 2, 2, 2, 217, 960, 3, 2, 2, 2, 219, 962, 3, 2, 2, 2, 221, 964, 3, 2, 2, 2, 223, 967, 3, 2, 2, 2, 225, 970, 3, 2, 2, 2, 227, 973, 3, 2, 2, 2, 229, 976, 3, 2, 2, 2, 231, 979, 3, 2, 2, 2, 233, 982, 3, 2, 2, 2, 235, 985, 3, 2, 2, 2, 237, 988, 3, 2, 2, 2, 239, 992, 3, 2, 2, 2, 241, 996, 3, 2, 2, 2, 243, 1001, 3, 2, 2, 2, 245, 1004, 3, 2, 2, 2, 247, 1007, 3, 2, 2, 2, 249, 1009, 3, 2, 2, 2, 251, 1014, 3, 2, 2, 2, 253, 1020, 3, 2, 2, 2, 255, 1034, 3, 2, 2, 2, 257, 1045, 3, 2, 2, 2, 259, 1052, 3, 2, 2, 2, 261, 1079, 3, 2, 2, 2, 263, 1081, 3, 2, 2, 2, 265, 1092, 3, 2, 2, 2, 267, 1094, 3, 2, 2, 2, 269, 1106, 3, 2, 2, 2, 271, 1112, 3, 2, 2, 2, 273, 274, 7, 99, 2, 2, 274, 275, 7, 100, 2, 2, 275, 276, 7, 117, 2, 2, 276, 277, 7, 118, 2, 2, 277, 278, 7, 116, 2, 2, 278, 279, 7, 99, 2, 2, 279, 280, 7, 101, 2, 2, 280, 281, 7, 118, 2, 2, 281, 4, 3, 2, 2, 2, 282, 283, 7, 99, 2, 2, 283, 284, 7, 117, 2, 2, 284, 285, 7, 117, 2, 2, 285, 286, 7, 103, 2, 2, 286, 287, 7, 116, 2, 2, 287, 288, 7, 118, 2, 2, 288, 6, 3, 2, 2, 2, 289, 290, 7, 100, 2, 2, 290, 291, 7, 113, 2, 2, 291, 292, 7, 113, 2, 2, 292, 293, 7, 110, 2, 2, 293, 294, 7, 103, 2, 2, 294, 295, 7, 99, 2, 2, 295, 296, 7, 112, 2, 2, 296, 8, 3, 2, 2, 2, 297, 298, 7, 100, 2, 2, 298, 299, 7, 116, 2, 2, 299, 300, 7, 103, 2, 2, 300, 301, 7, 99, 2, 2, 301, 302, 7, 109, 2, 2, 302, 10, 3, 2, 2, 2, 303, 304, 7, 100, 2, 2, 304, 305, 7, 123, 2, 2, 305, 306, 7, 118, 2, 2, 306, 307, 7, 103, 2, 2, 307, 12, 3, 2, 2, 2, 308, 309, 7, 101, 2, 2, 309, 310, 7, 99, 2, 2, 310, 311, 7, 117, 2, 2, 311, 312, 7, 103, 2, 2, 312, 14, 3, 2, 2, 2, 313, 314, 7, 101, 2, 2, 314, 315, 7, 99, 2, 2, 315, 316, 7, 118, 2, 2, 316, 317, 7, 101, 2, 2, 317, 318, 7, 106, 2, 2, 318, 16, 3, 2, 2, 2, 319, 320, 7, 101, 2, 2, 320, 321, 7, 106, 2, 2, 321, 322, 7, 99, 2, 2, 322, 323, 7, 116, 2, 2, 323, 18, 3, 2, 2, 2, 324, 325, 7, 101, 2, 2, 325, 326, 7, 110, 2, 2, 326, 327, 7, 99, 2, 2, 327, 328, 7, 117, 2, 2, 328, 329, 7, 117, 2, 2, 329, 20, 3, 2, 2, 2, 330, 331, 7, 101, 2, 2, 331, 332, 7, 113, 2, 2, 332, 333, 7, 112, 2, 2, 333, 334, 7, 117, 2, 2, 334, 335, 7, 118, 2, 2, 335, 22, 3, 2, 2, 2, 336, 337, 7, 101, 2, 2, 337, 338, 7, 113, 2, 2, 338, 339, 7, 112, 2, 2, 339, 340, 7, 118, 2, 2, 340, 341, 7, 107, 2, 2, 341, 342, 7, 112, 2, 2, 342, 343, 7, 119, 2, 2, 343, 344, 7, 103, 2, 2, 344, 24, 3, 2, 2, 2, 345, 346, 7, 102, 2, 2, 346, 347, 7, 103, 2, 2, 347, 348, 7, 104, 2, 2, 348, 349, 7, 99, 2, 2, 349, 350, 7, 119, 2, 2, 350, 351, 7, 110, 2, 2, 351, 352, 7, 118, 2, 2, 352, 26, 3, 2, 2, 2, 353, 354, 7, 102, 2, 2, 354, 355, 7, 113, 2, 2, 355, 28, 3, 2, 2, 2, 356, 357, 7, 102, 2, 2, 357, 358, 7, 113, 2, 2, 358, 359, 7, 119, 2, 2, 359, 360, 7, 100, 2, 2, 360, 361, 7, 110, 2, 2, 361, 362, 7, 103, 2, 2, 362, 30, 3, 2, 2, 2, 363, 364, 7, 103, 2, 2, 364, 365, 7, 110, 2, 2, 365, 366, 7, 117, 2, 2, 366, 367, 7, 103, 2, 2, 367, 32, 3, 2, 2, 2, 368, 369, 7, 103, 2, 2, 369, 370, 7, 112, 2, 2, 370, 371, 7, 119, 2, 2, 371, 372, 7, 111, 2, 2, 372, 34, 3, 2, 2, 2, 373, 374, 7, 103, 2, 2, 374, 375, 7, 122, 2, 2, 375, 376, 7, 118, 2, 2, 376, 377, 7, 103, 2, 2, 377, 378, 7, 112, 2, 2, 378, 379, 7, 102, 2, 2, 379, 380, 7, 117, 2, 2, 380, 36, 3, 2, 2, 2, 381, 382, 7, 104, 2, 2, 382, 383, 7, 107, 2, 2, 383, 384, 7, 112, 2, 2, 384, 385, 7, 99, 2, 2, 385, 386, 7, 110, 2, 2, 386, 38, 3, 2, 2, 2, 387, 388, 7, 104, 2, 2, 388, 389, 7, 107, 2, 2, 389, 390, 7, 112, 2, 2, 390, 391, 7, 99, 2, 2, 391, 392, 7, 110, 2, 2, 392, 393, 7, 110, 2, 2, 393, 394, 7, 123, 2, 2, 394, 40, 3, 2, 2, 2, 395, 396, 7, 104, 2, 2, 396, 397, 7, 110, 2, 2, 397, 398, 7, 113, 2, 2, 398, 399, 7, 99, 2, 2, 399, 400, 7, 118, 2, 2, 400, 42, 3, 2, 2, 2, 401, 402, 7, 104, 2, 2, 402, 403, 7, 113, 2, 2, 403, 404, 7, 116, 2, 2, 404, 44, 3, 2, 2, 2, 405, 406, 7, 107, 2, 2, 406, 407, 7, 104, 2, 2, 407, 46, 3, 2, 2, 2, 408, 409, 7, 105, 2, 2, 409, 410, 7, 113, 2, 2, 410, 411, 7, 118, 2, 2, 411, 412, 7, 113, 2, 2, 412, 48, 3, 2, 2, 2, 413, 414, 7, 107, 2, 2, 414, 415, 7, 111, 2, 2, 415, 416, 7, 114, 2, 2, 416, 417, 7, 110, 2, 2, 417, 418, 7, 103, 2, 2, 418, 419, 7, 111, 2, 2, 419, 420, 7, 103, 2, 2, 420, 421, 7, 112, 2, 2, 421, 422, 7, 118, 2, 2, 422, 423, 7, 117, 2, 2, 423, 50, 3, 2, 2, 2, 424, 425, 7, 107, 2, 2, 425, 426, 7, 111, 2, 2, 426, 427, 7, 114, 2, 2, 427, 428, 7, 113, 2, 2, 428, 429, 7, 116, 2, 2, 429, 430, 7, 118, 2, 2, 430, 52, 3, 2, 2, 2, 431, 432, 7, 107, 2, 2, 432, 433, 7, 112, 2, 2, 433, 434, 7, 117, 2, 2, 434, 435, 7, 118, 2, 2, 435, 436, 7, 99, 2, 2, 436, 437, 7, 112, 2, 2, 437, 438, 7, 101, 2, 2, 438, 439, 7, 103, 2, 2, 439, 440, 7, 113, 2, 2, 440, 441, 7, 104, 2, 2, 441, 54, 3, 2, 2, 2, 442, 443, 7, 107, 2, 2, 443, 444, 7, 112, 2, 2, 444, 445, 7, 118, 2, 2, 445, 56, 3, 2, 2, 2, 446, 447, 7, 107, 2, 2, 447, 448, 7, 112, 2, 2, 448, 449, 7, 118, 2, 2, 449, 450, 7, 103, 2, 2, 450, 451, 7, 116, 2, 2, 451, 452, 7, 104, 2, 2, 452, 453, 7, 99, 2, 2, 453, 454, 7, 101, 2, 2, 454, 455, 7, 103, 2, 2, 455, 58, 3, 2, 2, 2, 456, 457, 7, 110, 2, 2, 457, 458, 7, 113, 2, 2, 458, 459, 7, 112, 2, 2, 459, 460, 7, 105, 2, 2, 460, 60, 3, 2, 2, 2, 461, 462, 7, 112, 2, 2, 462, 463, 7, 99, 2, 2, 463, 464, 7, 118, 2, 2, 464, 465, 7, 107, 2, 2, 465, 466, 7, 120, 2, 2, 466, 467, 7, 103, 2, 2, 467, 62, 3, 2, 2, 2, 468, 469, 7, 112, 2, 2, 469, 470, 7, 103, 2, 2, 470, 471, 7, 121, 2, 2, 471, 64, 3, 2, 2, 2, 472, 473, 7, 114, 2, 2, 473, 474, 7, 99, 2, 2, 474, 475, 7, 101, 2, 2, 475, 476, 7, 109, 2, 2, 476, 477, 7, 99, 2, 2, 477, 478, 7, 105, 2, 2, 478, 479, 7, 103, 2, 2, 479, 66, 3, 2, 2, 2, 480, 481, 7, 114, 2, 2, 481, 482, 7, 116, 2, 2, 482, 483, 7, 107, 2, 2, 483, 484, 7, 120, 2, 2, 484, 485, 7, 99, 2, 2, 485, 486, 7, 118, 2, 2, 486, 487, 7, 103, 2, 2, 487, 68, 3, 2, 2, 2, 488, 489, 7, 114, 2, 2, 489, 490, 7, 116, 2, 2, 490, 491, 7, 113, 2, 2, 491, 492, 7, 118, 2, 2, 492, 493, 7, 103, 2, 2, 493, 494, 7, 101, 2, 2, 494, 495, 7, 118, 2, 2, 495, 496, 7, 103, 2, 2, 496, 497, 7, 102, 2, 2, 497, 70, 3, 2, 2, 2, 498, 499, 7, 114, 2, 2, 499, 500, 7, 119, 2, 2, 500, 501, 7, 100, 2, 2, 501, 502, 7, 110, 2, 2, 502, 503, 7, 107, 2, 2, 503, 504, 7, 101, 2, 2, 504, 72, 3, 2, 2, 2, 505, 506, 7, 116, 2, 2, 506, 507, 7, 103, 2, 2, 507, 508, 7, 118, 2, 2, 508, 509, 7, 119, 2, 2, 509, 510, 7, 116, 2, 2, 510, 511, 7, 112, 2, 2, 511, 74, 3, 2, 2, 2, 512, 513, 7, 117, 2, 2, 513, 514, 7, 106, 2, 2, 514, 515, 7, 113, 2, 2, 515, 516, 7, 116, 2, 2, 516, 517, 7, 118, 2, 2, 517, 76, 3, 2, 2, 2, 518, 519, 7, 117, 2, 2, 519, 520, 7, 118, 2, 2, 520, 521, 7, 99, 2, 2, 521, 522, 7, 118, 2, 2, 522, 523, 7, 107, 2, 2, 523, 524, 7, 101, 2, 2, 524, 78, 3, 2, 2, 2, 525, 526, 7, 117, 2, 2, 526, 527, 7, 118, 2, 2, 527, 528, 7, 116, 2, 2, 528, 529, 7, 107, 2, 2, 529, 530, 7, 101, 2, 2, 530, 531, 7, 118, 2, 2, 531, 532, 7, 104, 2, 2, 532, 533, 7, 114, 2, 2, 533, 80, 3, 2, 2, 2, 534, 535, 7, 117, 2, 2, 535, 536, 7, 119, 2, 2, 536, 537, 7, 114, 2, 2, 537, 538, 7, 103, 2, 2, 538, 539, 7, 116, 2, 2, 539, 82, 3, 2, 2, 2, 540, 541, 7, 117, 2, 2, 541, 542, 7, 121, 2, 2, 542, 543, 7, 107, 2, 2, 543, 544, 7, 118, 2, 2, 544, 545, 7, 101, 2, 2, 545, 546, 7, 106, 2, 2, 546, 84, 3, 2, 2, 2, 547, 548, 7, 117, 2, 2, 548, 549, 7, 123, 2, 2, 549, 550, 7, 112, 2, 2, 550, 551, 7, 101, 2, 2, 551, 552, 7, 106, 2, 2, 552, 553, 7, 116, 2, 2, 553, 554, 7, 113, 2, 2, 554, 555, 7, 112, 2, 2, 555, 556, 7, 107, 2, 2, 556, 557, 7, 124, 2, 2, 557, 558, 7, 103, 2, 2, 558, 559, 7, 102, 2, 2, 559, 86, 3, 2, 2, 2, 560, 561, 7, 118, 2, 2, 561, 562, 7, 106, 2, 2, 562, 563, 7, 107, 2, 2, 563, 564, 7, 117, 2, 2, 564, 88, 3, 2, 2, 2, 565, 566, 7, 118, 2, 2, 566, 567, 7, 106, 2, 2, 567, 568, 7, 116, 2, 2, 568, 569, 7, 113, 2, 2, 569, 570, 7, 121, 2, 2, 570, 90, 3, 2, 2, 2, 571, 572, 7, 118, 2, 2, 572, 573, 7, 106, 2, 2, 573, 574, 7, 116, 2, 2, 574, 575, 7, 113, 2, 2, 575, 576, 7, 121, 2, 2, 576, 577, 7, 117, 2, 2, 577, 92, 3, 2, 2, 2, 578, 579, 7, 118, 2, 2, 579, 580, 7, 116, 2, 2, 580, 581, 7, 99, 2, 2, 581, 582, 7, 112, 2, 2, 582, 583, 7, 117, 2, 2, 583, 584, 7, 107, 2, 2, 584, 585, 7, 103, 2, 2, 585, 586, 7, 112, 2, 2, 586, 587, 7, 118, 2, 2, 587, 94, 3, 2, 2, 2, 588, 589, 7, 118, 2, 2, 589, 590, 7, 116, 2, 2, 590, 591, 7, 123, 2, 2, 591, 96, 3, 2, 2, 2, 592, 593, 7, 120, 2, 2, 593, 594, 7, 113, 2, 2, 594, 595, 7, 107, 2, 2, 595, 596, 7, 102, 2, 2, 596, 98, 3, 2, 2, 2, 597, 598, 7, 120, 2, 2, 598, 599, 7, 113, 2, 2, 599, 600, 7, 110, 2, 2, 600, 601, 7, 99, 2, 2, 601, 602, 7, 118, 2, 2, 602, 603, 7, 107, 2, 2, 603, 604, 7, 110, 2, 2, 604, 605, 7, 103, 2, 2, 605, 100, 3, 2, 2, 2, 606, 607, 7, 121, 2, 2, 607, 608, 7, 106, 2, 2, 608, 609, 7, 107, 2, 2, 609, 610, 7, 110, 2, 2, 610, 611, 7, 103, 2, 2, 611, 102, 3, 2, 2, 2, 612, 613, 7, 111, 2, 2, 613, 614, 7, 113, 2, 2, 614, 615, 7, 102, 2, 2, 615, 616, 7, 119, 2, 2, 616, 617, 7, 110, 2, 2, 617, 618, 7, 103, 2, 2, 618, 104, 3, 2, 2, 2, 619, 620, 7, 113, 2, 2, 620, 621, 7, 114, 2, 2, 621, 622, 7, 103, 2, 2, 622, 623, 7, 112, 2, 2, 623, 106, 3, 2, 2, 2, 624, 625, 7, 116, 2, 2, 625, 626, 7, 103, 2, 2, 626, 627, 7, 115, 2, 2, 627, 628, 7, 119, 2, 2, 628, 629, 7, 107, 2, 2, 629, 630, 7, 116, 2, 2, 630, 631, 7, 103, 2, 2, 631, 632, 7, 117, 2, 2, 632, 108, 3, 2, 2, 2, 633, 634, 7, 103, 2, 2, 634, 635, 7, 122, 2, 2, 635, 636, 7, 114, 2, 2, 636, 637, 7, 113, 2, 2, 637, 638, 7, 116, 2, 2, 638, 639, 7, 118, 2, 2, 639, 640, 7, 117, 2, 2, 640, 110, 3, 2, 2, 2, 641, 642, 7, 113, 2, 2, 642, 643, 7, 114, 2, 2, 643, 644, 7, 103, 2, 2, 644, 645, 7, 112, 2, 2, 645, 646, 7, 117, 2, 2, 646, 112, 3, 2, 2, 2, 647, 648, 7, 118, 2, 2, 648, 649, 7, 113, 2, 2, 649, 114, 3, 2, 2, 2, 650, 651, 7, 119, 2, 2, 651, 652, 7, 117, 2, 2, 652, 653, 7, 103, 2, 2, 653, 654, 7, 117, 2, 2, 654, 116, 3, 2, 2, 2, 655, 656, 7, 114, 2, 2, 656, 657, 7, 116, 2, 2, 657, 658, 7, 113, 2, 2, 658, 659, 7, 120, 2, 2, 659, 660, 7, 107, 2, 2, 660, 661, 7, 102, 2, 2, 661, 662, 7, 103, 2, 2, 662, 663, 7, 117, 2, 2, 663, 118, 3, 2, 2, 2, 664, 665, 7, 121, 2, 2, 665, 666, 7, 107, 2, 2, 666, 667, 7, 118, 2, 2, 667, 668, 7, 106, 2, 2, 668, 120, 3, 2, 2, 2, 669, 670, 7, 118, 2, 2, 670, 671, 7, 116, 2, 2, 671, 672, 7, 99, 2, 2, 672, 673, 7, 112, 2, 2, 673, 674, 7, 117, 2, 2, 674, 675, 7, 107, 2, 2, 675, 676, 7, 118, 2, 2, 676, 677, 7, 107, 2, 2, 677, 678, 7, 120, 2, 2, 678, 679, 7, 103, 2, 2, 679, 122, 3, 2, 2, 2, 680, 681, 7, 120, 2, 2, 681, 682, 7, 99, 2, 2, 682, 683, 7, 116, 2, 2, 683, 124, 3, 2, 2, 2, 684, 685, 7, 123, 2, 2, 685, 686, 7, 107, 2, 2, 686, 687, 7, 103, 2, 2, 687, 688, 7, 110, 2, 2, 688, 689, 7, 102, 2, 2, 689, 126, 3, 2, 2, 2, 690, 691, 7, 116, 2, 2, 691, 692, 7, 103, 2, 2, 692, 693, 7, 101, 2, 2, 693, 694, 7, 113, 2, 2, 694, 695, 7, 116, 2, 2, 695, 696, 7, 102, 2, 2, 696, 128, 3, 2, 2, 2, 697, 698, 7, 117, 2, 2, 698, 699, 7, 103, 2, 2, 699, 700, 7, 99, 2, 2, 700, 701, 7, 110, 2, 2, 701, 702, 7, 103, 2, 2, 702, 703, 7, 102, 2, 2, 703, 130, 3, 2, 2, 2, 704, 705, 7, 114, 2, 2, 705, 706, 7, 103, 2, 2, 706, 707, 7, 116, 2, 2, 707, 708, 7, 111, 2, 2, 708, 709, 7, 107, 2, 2, 709, 710, 7, 118, 2, 2, 710, 711, 7, 117, 2, 2, 711, 132, 3, 2, 2, 2, 712, 713, 7, 112, 2, 2, 713, 714, 7, 113, 2, 2, 714, 715, 7, 112, 2, 2, 715, 716, 7, 47, 2, 2, 716, 717, 7, 117, 2, 2, 717, 718, 7, 103, 2, 2, 718, 719, 7, 99, 2, 2, 719, 720, 7, 110, 2, 2, 720, 721, 7, 103, 2, 2, 721, 722, 7, 102, 2, 2, 722, 134, 3, 2, 2, 2, 723, 737, 7, 50, 2, 2, 724, 734, 9, 2, 2, 2, 725, 727, 5, 267, 134, 2, 726, 725, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 735, 3, 2, 2, 2, 728, 730, 7, 97, 2, 2, 729, 728, 3, 2, 2, 2, 730, 731, 3, 2, 2, 2, 731, 729, 3, 2, 2, 2, 731, 732, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, 735, 5, 267, 134, 2, 734, 726, 3, 2, 2, 2, 734, 729, 3, 2, 2, 2, 735, 737, 3, 2, 2, 2, 736, 723, 3, 2, 2, 2, 736, 724, 3, 2, 2, 2, 737, 739, 3, 2, 2, 2, 738, 740, 9, 3, 2, 2, 739, 738, 3, 2, 2, 2, 739, 740, 3, 2, 2, 2, 740, 136, 3, 2, 2, 2, 741, 742, 7, 50, 2, 2, 742, 743, 9, 4, 2, 2, 743, 751, 9, 5, 2, 2, 744, 746, 9, 6, 2, 2, 745, 744, 3, 2, 2, 2, 746, 749, 3, 2, 2, 2, 747, 745, 3, 2, 2, 2, 747, 748, 3, 2, 2, 2, 748, 750, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 750, 752, 9, 5, 2, 2, 751, 747, 3, 2, 2, 2, 751, 752, 3, 2, 2, 2, 752, 754, 3, 2, 2, 2, 753, 755, 9, 3, 2, 2, 754, 753, 3, 2, 2, 2, 754, 755, 3, 2, 2, 2, 755, 138, 3, 2, 2, 2, 756, 760, 7, 50, 2, 2, 757, 759, 7, 97, 2, 2, 758, 757, 3, 2, 2, 2, 759, 762, 3, 2, 2, 2, 760, 758, 3, 2, 2, 2, 760, 761, 3, 2, 2, 2, 761, 763, 3, 2, 2, 2, 762, 760, 3, 2, 2, 2, 763, 771, 9, 7, 2, 2, 764, 766, 9, 8, 2, 2, 765, 764, 3, 2, 2, 2, 766, 769, 3, 2, 2, 2, 767, 765, 3, 2, 2, 2, 767, 768, 3, 2, 2, 2, 768, 770, 3, 2, 2, 2, 769, 767, 3, 2, 2, 2, 770, 772, 9, 7, 2, 2, 771, 767, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 774, 3, 2, 2, 2, 773, 775, 9, 3, 2, 2, 774, 773, 3, 2, 2, 2, 774, 775, 3, 2, 2, 2, 775, 140, 3, 2, 2, 2, 776, 777, 7, 50, 2, 2, 777, 778, 9, 9, 2, 2, 778, 786, 9, 10, 2, 2, 779, 781, 9, 11, 2, 2, 780, 779, 3, 2, 2, 2, 781, 784, 3, 2, 2, 2, 782, 780, 3, 2, 2, 2, 782, 783, 3, 2, 2, 2, 783, 785, 3, 2, 2, 2, 784, 782, 3, 2, 2, 2, 785, 787, 9, 10, 2, 2, 786, 782, 3, 2, 2, 2, 786, 787, 3, 2, 2, 2, 787, 789, 3, 2, 2, 2, 788, 790, 9, 3, 2, 2, 789, 788, 3, 2, 2, 2, 789, 790, 3, 2, 2, 2, 790, 142, 3, 2, 2, 2, 791, 792, 5, 267, 134, 2, 792, 794, 7, 48, 2, 2, 793, 795, 5, 267, 134, 2, 794, 793, 3, 2, 2, 2, 794, 795, 3, 2, 2, 2, 795, 799, 3, 2, 2, 2, 796, 797, 7, 48, 2, 2, 797, 799, 5, 267, 134, 2, 798, 791, 3, 2, 2, 2, 798, 796, 3, 2, 2, 2, 799, 801, 3, 2, 2, 2, 800, 802, 5, 259, 130, 2, 801, 800, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 804, 3, 2, 2, 2, 803, 805, 9, 12, 2, 2, 804, 803, 3, 2, 2, 2, 804, 805, 3, 2, 2, 2, 805, 815, 3, 2, 2, 2, 806, 812, 5, 267, 134, 2, 807, 809, 5, 259, 130, 2, 808, 810, 9, 12, 2, 2, 809, 808, 3, 2, 2, 2, 809, 810, 3, 2, 2, 2, 810, 813, 3, 2, 2, 2, 811, 813, 9, 12, 2, 2, 812, 807, 3, 2, 2, 2, 812, 811, 3, 2, 2, 2, 813, 815, 3, 2, 2, 2, 814, 798, 3, 2, 2, 2, 814, 806, 3, 2, 2, 2, 815, 144, 3, 2, 2, 2, 816, 817, 7, 50, 2, 2, 817, 827, 9, 4, 2, 2, 818, 820, 5, 263, 132, 2, 819, 821, 7, 48, 2, 2, 820, 819, 3, 2, 2, 2, 820, 821, 3, 2, 2, 2, 821, 828, 3, 2, 2, 2, 822, 824, 5, 263, 132, 2, 823, 822, 3, 2, 2, 2, 823, 824, 3, 2, 2, 2, 824, 825, 3, 2, 2, 2, 825, 826, 7, 48, 2, 2, 826, 828, 5, 263, 132, 2, 827, 818, 3, 2, 2, 2, 827, 823, 3, 2, 2, 2, 828, 829, 3, 2, 2, 2, 829, 831, 9, 13, 2, 2, 830, 832, 9, 14, 2, 2, 831, 830, 3, 2, 2, 2, 831, 832, 3, 2, 2, 2, 832, 833, 3, 2, 2, 2, 833, 835, 5, 267, 134, 2, 834, 836, 9, 12, 2, 2, 835, 834, 3, 2, 2, 2, 835, 836, 3, 2, 2, 2, 836, 146, 3, 2, 2, 2, 837, 838, 7, 118, 2, 2, 838, 839, 7, 116, 2, 2, 839, 840, 7, 119, 2, 2, 840, 847, 7, 103, 2, 2, 841, 842, 7, 104, 2, 2, 842, 843, 7, 99, 2, 2, 843, 844, 7, 110, 2, 2, 844, 845, 7, 117, 2, 2, 845, 847, 7, 103, 2, 2, 846, 837, 3, 2, 2, 2, 846, 841, 3, 2, 2, 2, 847, 148, 3, 2, 2, 2, 848, 851, 7, 41, 2, 2, 849, 852, 10, 15, 2, 2, 850, 852, 5, 261, 131, 2, 851, 849, 3, 2, 2, 2, 851, 850, 3, 2, 2, 2, 852, 853, 3, 2, 2, 2, 853, 854, 7, 41, 2, 2, 854, 150, 3, 2, 2, 2, 855, 860, 7, 36, 2, 2, 856, 859, 10, 16, 2, 2, 857, 859, 5, 261, 131, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 862, 3, 2, 2, 2, 860, 858, 3, 2, 2, 2, 860, 861, 3, 2, 2, 2, 861, 863, 3, 2, 2, 2, 862, 860, 3, 2, 2, 2, 863, 864, 7, 36, 2, 2, 864, 152, 3, 2, 2, 2, 865, 866, 7, 36, 2, 2, 866, 867, 7, 36, 2, 2, 867, 868, 7, 36, 2, 2, 868, 872, 3, 2, 2, 2, 869, 871, 9, 17, 2, 2, 870, 869, 3, 2, 2, 2, 871, 874, 3, 2, 2, 2, 872, 870, 3, 2, 2, 2, 872, 873, 3, 2, 2, 2, 873, 875, 3, 2, 2, 2, 874, 872, 3, 2, 2, 2, 875, 880, 9, 18, 2, 2, 876, 879, 11, 2, 2, 2, 877, 879, 5, 261, 131, 2, 878, 876, 3, 2, 2, 2, 878, 877, 3, 2, 2, 2, 879, 882, 3, 2, 2, 2, 880, 881, 3, 2, 2, 2, 880, 878, 3, 2, 2, 2, 881, 883, 3, 2, 2, 2, 882, 880, 3, 2, 2, 2, 883, 884, 7, 36, 2, 2, 884, 885, 7, 36, 2, 2, 885, 886, 7, 36, 2, 2, 886, 154, 3, 2, 2, 2, 887, 888, 7, 112, 2, 2, 888, 889, 7, 119, 2, 2, 889, 890, 7, 110, 2, 2, 890, 891, 7, 110, 2, 2, 891, 156, 3, 2, 2, 2, 892, 893, 7, 42, 2, 2, 893, 158, 3, 2, 2, 2, 894, 895, 7, 43, 2, 2, 895, 160, 3, 2, 2, 2, 896, 897, 7, 125, 2, 2, 897, 162, 3, 2, 2, 2, 898, 899, 7, 127, 2, 2, 899, 164, 3, 2, 2, 2, 900, 901, 7, 93, 2, 2, 901, 166, 3, 2, 2, 2, 902, 903, 7, 95, 2, 2, 903, 168, 3, 2, 2, 2, 904, 905, 7, 61, 2, 2, 905, 170, 3, 2, 2, 2, 906, 907, 7, 46, 2, 2, 907, 172, 3, 2, 2, 2, 908, 909, 7, 48, 2, 2, 909, 174, 3, 2, 2, 2, 910, 911, 7, 63, 2, 2, 911, 176, 3, 2, 2, 2, 912, 913, 7, 64, 2, 2, 913, 178, 3, 2, 2, 2, 914, 915, 7, 62, 2, 2, 915, 180, 3, 2, 2, 2, 916, 917, 7, 35, 2, 2, 917, 182, 3, 2, 2, 2, 918, 919, 7, 128, 2, 2, 919, 184, 3, 2, 2, 2, 920, 921, 7, 65, 2, 2, 921, 186, 3, 2, 2, 2, 922, 923, 7, 60, 2, 2, 923, 188, 3, 2, 2, 2, 924, 925, 7, 63, 2, 2, 925, 926, 7, 63, 2, 2, 926, 190, 3, 2, 2, 2, 927, 928, 7, 62, 2, 2, 928, 929, 7, 63, 2, 2, 929, 192, 3, 2, 2, 2, 930, 931, 7, 64, 2, 2, 931, 932, 7, 63, 2, 2, 932, 194, 3, 2, 2, 2, 933, 934, 7, 35, 2, 2, 934, 935, 7, 63, 2, 2, 935, 196, 3, 2, 2, 2, 936, 937, 7, 40, 2, 2, 937, 938, 7, 40, 2, 2, 938, 198, 3, 2, 2, 2, 939, 940, 7, 126, 2, 2, 940, 941, 7, 126, 2, 2, 941, 200, 3, 2, 2, 2, 942, 943, 7, 45, 2, 2, 943, 944, 7, 45, 2, 2, 944, 202, 3, 2, 2, 2, 945, 946, 7, 47, 2, 2, 946, 947, 7, 47, 2, 2, 947, 204, 3, 2, 2, 2, 948, 949, 7, 45, 2, 2, 949, 206, 3, 2, 2, 2, 950, 951, 7, 47, 2, 2, 951, 208, 3, 2, 2, 2, 952, 953, 7, 44, 2, 2, 953, 210, 3, 2, 2, 2, 954, 955, 7, 49, 2, 2, 955, 212, 3, 2, 2, 2, 956, 957, 7, 40, 2, 2, 957, 214, 3, 2, 2, 2, 958, 959, 7, 126, 2, 2, 959, 216, 3, 2, 2, 2, 960, 961, 7, 96, 2, 2, 961, 218, 3, 2, 2, 2, 962, 963, 7, 39, 2, 2, 963, 220, 3, 2, 2, 2, 964, 965, 7, 45, 2, 2, 965, 966, 7, 63, 2, 2, 966, 222, 3, 2, 2, 2, 967, 968, 7, 47, 2, 2, 968, 969, 7, 63, 2, 2, 969, 224, 3, 2, 2, 2, 970, 971, 7, 44, 2, 2, 971, 972, 7, 63, 2, 2, 972, 226, 3, 2, 2, 2, 973, 974, 7, 49, 2, 2, 974, 975, 7, 63, 2, 2, 975, 228, 3, 2, 2, 2, 976, 977, 7, 40, 2, 2, 977, 978, 7, 63, 2, 2, 978, 230, 3, 2, 2, 2, 979, 980, 7, 126, 2, 2, 980, 981, 7, 63, 2, 2, 981, 232, 3, 2, 2, 2, 982, 983, 7, 96, 2, 2, 983, 984, 7, 63, 2, 2, 984, 234, 3, 2, 2, 2, 985, 986, 7, 39, 2, 2, 986, 987, 7, 63, 2, 2, 987, 236, 3, 2, 2, 2, 988, 989, 7, 62, 2, 2, 989, 990, 7, 62, 2, 2, 990, 991, 7, 63, 2, 2, 991, 238, 3, 2, 2, 2, 992, 993, 7, 64, 2, 2, 993, 994, 7, 64, 2, 2, 994, 995, 7, 63, 2, 2, 995, 240, 3, 2, 2, 2, 996, 997, 7, 64, 2, 2, 997, 998, 7, 64, 2, 2, 998, 999, 7, 64, 2, 2, 999, 1000, 7, 63, 2, 2, 1000, 242, 3, 2, 2, 2, 1001, 1002, 7, 47, 2, 2, 1002, 1003, 7, 64, 2, 2, 1003, 244, 3, 2, 2, 2, 1004, 1005, 7, 60, 2, 2, 1005, 1006, 7, 60, 2, 2, 1006, 246, 3, 2, 2, 2, 1007, 1008, 7, 66, 2, 2, 1008, 248, 3, 2, 2, 2, 1009, 1010, 7, 48, 2, 2, 1010, 1011, 7, 48, 2, 2, 1011, 1012, 7, 48, 2, 2, 1012, 250, 3, 2, 2, 2, 1013, 1015, 9, 19, 2, 2, 1014, 1013, 3, 2, 2, 2, 1015, 1016, 3, 2, 2, 2, 1016, 1014, 3, 2, 2, 2, 1016, 1017, 3, 2, 2, 2, 1017, 1018, 3, 2, 2, 2, 1018, 1019, 8, 126, 2, 2, 1019, 252, 3, 2, 2, 2, 1020, 1021, 7, 49, 2, 2, 1021, 1022, 7, 44, 2, 2, 1022, 1026, 3, 2, 2, 2, 1023, 1025, 11, 2, 2, 2, 1024, 1023, 3, 2, 2, 2, 1025, 1028, 3, 2, 2, 2, 1026, 1027, 3, 2, 2, 2, 1026, 1024, 3, 2, 2, 2, 1027, 1029, 3, 2, 2, 2, 1028, 1026, 3, 2, 2, 2, 1029, 1030, 7, 44, 2, 2, 1030, 1031, 7, 49, 2, 2, 1031, 1032, 3, 2, 2, 2, 1032, 1033, 8, 127, 2, 2, 1033, 254, 3, 2, 2, 2, 1034, 1035, 7, 49, 2, 2, 1035, 1036, 7, 49, 2, 2, 1036, 1040, 3, 2, 2, 2, 1037, 1039, 10, 18, 2, 2, 1038, 1037, 3, 2, 2, 2, 1039, 1042, 3, 2, 2, 2, 1040, 1038, 3, 2, 2, 2, 1040, 1041, 3, 2, 2, 2, 1041, 1043, 3, 2, 2, 2, 1042, 1040, 3, 2, 2, 2, 1043, 1044, 8, 128, 2, 2, 1044, 256, 3, 2, 2, 2, 1045, 1049, 5, 271, 136, 2, 1046, 1048, 5, 269, 135, 2, 1047, 1046, 3, 2, 2, 2, 1048, 1051, 3, 2, 2, 2, 1049, 1047, 3, 2, 2, 2, 1049, 1050, 3, 2, 2, 2, 1050, 258, 3, 2, 2, 2, 1051, 1049, 3, 2, 2, 2, 1052, 1054, 9, 20, 2, 2, 1053, 1055, 9, 14, 2, 2, 1054, 1053, 3, 2, 2, 2, 1054, 1055, 3, 2, 2, 2, 1055, 1056, 3, 2, 2, 2, 1056, 1057, 5, 267, 134, 2, 1057, 260, 3, 2, 2, 2, 1058, 1059, 7, 94, 2, 2, 1059, 1080, 9, 21, 2, 2, 1060, 1065, 7, 94, 2, 2, 1061, 1063, 9, 22, 2, 2, 1062, 1061, 3, 2, 2, 2, 1062, 1063, 3, 2, 2, 2, 1063, 1064, 3, 2, 2, 2, 1064, 1066, 9, 7, 2, 2, 1065, 1062, 3, 2, 2, 2, 1065, 1066, 3, 2, 2, 2, 1066, 1067, 3, 2, 2, 2, 1067, 1080, 9, 7, 2, 2, 1068, 1070, 7, 94, 2, 2, 1069, 1071, 7, 119, 2, 2, 1070, 1069, 3, 2, 2, 2, 1071, 1072, 3, 2, 2, 2, 1072, 1070, 3, 2, 2, 2, 1072, 1073, 3, 2, 2, 2, 1073, 1074, 3, 2, 2, 2, 1074, 1075, 5, 265, 133, 2, 1075, 1076, 5, 265, 133, 2, 1076, 1077, 5, 265, 133, 2, 1077, 1078, 5, 265, 133, 2, 1078, 1080, 3, 2, 2, 2, 1079, 1058, 3, 2, 2, 2, 1079, 1060, 3, 2, 2, 2, 1079, 1068, 3, 2, 2, 2, 1080, 262, 3, 2, 2, 2, 1081, 1090, 5, 265, 133, 2, 1082, 1085, 5, 265, 133, 2, 1083, 1085, 7, 97, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1083, 3, 2, 2, 2, 1085, 1088, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1086, 1087, 3, 2, 2, 2, 1087, 1089, 3, 2, 2, 2, 1088, 1086, 3, 2, 2, 2, 1089, 1091, 5, 265, 133, 2, 1090, 1086, 3, 2, 2, 2, 1090, 1091, 3, 2, 2, 2, 1091, 264, 3, 2, 2, 2, 1092, 1093, 9, 5, 2, 2, 1093, 266, 3, 2, 2, 2, 1094, 1102, 9, 23, 2, 2, 1095, 1097, 9, 24, 2, 2, 1096, 1095, 3, 2, 2, 2, 1097, 1100, 3, 2, 2, 2, 1098, 1096, 3, 2, 2, 2, 1098, 1099, 3, 2, 2, 2, 1099, 1101, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1101, 1103, 9, 23, 2, 2, 1102, 1098, 3, 2, 2, 2, 1102, 1103, 3, 2, 2, 2, 1103, 268, 3, 2, 2, 2, 1104, 1107, 5, 271, 136, 2, 1105, 1107, 9, 23, 2, 2, 1106, 1104, 3, 2, 2, 2, 1106, 1105, 3, 2, 2, 2, 1107, 270, 3, 2, 2, 2, 1108, 1113, 9, 25, 2, 2, 1109, 1113, 10, 26, 2, 2, 1110, 1111, 9, 27, 2, 2, 1111, 1113, 9, 28, 2, 2, 1112, 1108, 3, 2, 2, 2, 1112, 1109, 3, 2, 2, 2, 1112, 1110, 3, 2, 2, 2, 1113, 272, 3, 2, 2, 2, 53, 2, 726, 731, 734, 736, 739, 747, 751, 754, 760, 767, 771, 774, 782, 786, 789, 794, 798, 801, 804, 809, 812, 814, 820, 823, 827, 831, 835, 846, 851, 858, 860, 872, 878, 880, 1016, 1026, 1040, 1049, 1054, 1062, 1065, 1072, 1079, 1084, 1086, 1090, 1098, 1102, 1106, 1112, 3, 2, 3, 2] \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.java new file mode 100644 index 00000000..1b4d6730 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.java @@ -0,0 +1,581 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class JavaLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, + CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, + ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, + IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, + NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, + SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, + THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, + WHILE=50, MODULE=51, OPEN=52, REQUIRES=53, EXPORTS=54, OPENS=55, TO=56, + USES=57, PROVIDES=58, WITH=59, TRANSITIVE=60, VAR=61, YIELD=62, RECORD=63, + SEALED=64, PERMITS=65, NON_SEALED=66, DECIMAL_LITERAL=67, HEX_LITERAL=68, + OCT_LITERAL=69, BINARY_LITERAL=70, FLOAT_LITERAL=71, HEX_FLOAT_LITERAL=72, + BOOL_LITERAL=73, CHAR_LITERAL=74, STRING_LITERAL=75, TEXT_BLOCK=76, NULL_LITERAL=77, + LPAREN=78, RPAREN=79, LBRACE=80, RBRACE=81, LBRACK=82, RBRACK=83, SEMI=84, + COMMA=85, DOT=86, ASSIGN=87, GT=88, LT=89, BANG=90, TILDE=91, QUESTION=92, + COLON=93, EQUAL=94, LE=95, GE=96, NOTEQUAL=97, AND=98, OR=99, INC=100, + DEC=101, ADD=102, SUB=103, MUL=104, DIV=105, BITAND=106, BITOR=107, CARET=108, + MOD=109, ADD_ASSIGN=110, SUB_ASSIGN=111, MUL_ASSIGN=112, DIV_ASSIGN=113, + AND_ASSIGN=114, OR_ASSIGN=115, XOR_ASSIGN=116, MOD_ASSIGN=117, LSHIFT_ASSIGN=118, + RSHIFT_ASSIGN=119, URSHIFT_ASSIGN=120, ARROW=121, COLONCOLON=122, AT=123, + ELLIPSIS=124, WS=125, COMMENT=126, LINE_COMMENT=127, IDENTIFIER=128; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", "CHAR", + "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", "ENUM", + "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", "IMPLEMENTS", + "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", + "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", + "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", + "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", "OPEN", "REQUIRES", + "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", "TRANSITIVE", "VAR", + "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", "DECIMAL_LITERAL", + "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL", + "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", "TEXT_BLOCK", "NULL_LITERAL", + "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "SEMI", "COMMA", + "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION", "COLON", "EQUAL", + "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD", "SUB", "MUL", + "DIV", "BITAND", "BITOR", "CARET", "MOD", "ADD_ASSIGN", "SUB_ASSIGN", + "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", "OR_ASSIGN", "XOR_ASSIGN", + "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", "URSHIFT_ASSIGN", "ARROW", + "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT", "IDENTIFIER", + "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits", + "LetterOrDigit", "Letter" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'", "'case'", + "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'", + "'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", + "'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", + "'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'", + "'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'", + "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", + "'transient'", "'try'", "'void'", "'volatile'", "'while'", "'module'", + "'open'", "'requires'", "'exports'", "'opens'", "'to'", "'uses'", "'provides'", + "'with'", "'transitive'", "'var'", "'yield'", "'record'", "'sealed'", + "'permits'", "'non-sealed'", null, null, null, null, null, null, null, + null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'", + "';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", + "'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", + "'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", + "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'->'", + "'::'", "'@'", "'...'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", + "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", + "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", + "IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", + "NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", + "STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", + "THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", + "OPEN", "REQUIRES", "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", + "TRANSITIVE", "VAR", "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", + "DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", + "HEX_FLOAT_LITERAL", "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", + "TEXT_BLOCK", "NULL_LITERAL", "LPAREN", "RPAREN", "LBRACE", "RBRACE", + "LBRACK", "RBRACK", "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", + "TILDE", "QUESTION", "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", + "OR", "INC", "DEC", "ADD", "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", + "MOD", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", + "OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", + "URSHIFT_ASSIGN", "ARROW", "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", + "LINE_COMMENT", "IDENTIFIER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public JavaLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "JavaLexer.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u0082\u045a\b\1\4"+ + "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ + "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ + "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ + "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ + " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ + "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ + "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t"+ + "=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4"+ + "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\t"+ + "T\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_"+ + "\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k"+ + "\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv"+ + "\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t"+ + "\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084"+ + "\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\3\2\3"+ + "\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4"+ + "\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3"+ + "\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n"+ + "\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ + "\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17"+ + "\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21"+ + "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23"+ + "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25"+ + "\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31"+ + "\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32"+ + "\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34"+ + "\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36"+ + "\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3"+ + "!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#"+ + "\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&"+ + "\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3)\3)\3"+ + ")\3)\3)\3)\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3"+ + "+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3"+ + "/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62"+ + "\3\62\3\62\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\64"+ + "\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\66"+ + "\3\66\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67"+ + "\38\38\38\38\38\38\39\39\39\3:\3:\3:\3:\3:\3;\3;\3;\3;\3;\3;\3;\3;\3;"+ + "\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?"+ + "\3?\3?\3?\3@\3@\3@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B"+ + "\3B\3B\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\5D\u02d7\nD\3D\6D\u02da"+ + "\nD\rD\16D\u02db\3D\5D\u02df\nD\5D\u02e1\nD\3D\5D\u02e4\nD\3E\3E\3E\3"+ + "E\7E\u02ea\nE\fE\16E\u02ed\13E\3E\5E\u02f0\nE\3E\5E\u02f3\nE\3F\3F\7F"+ + "\u02f7\nF\fF\16F\u02fa\13F\3F\3F\7F\u02fe\nF\fF\16F\u0301\13F\3F\5F\u0304"+ + "\nF\3F\5F\u0307\nF\3G\3G\3G\3G\7G\u030d\nG\fG\16G\u0310\13G\3G\5G\u0313"+ + "\nG\3G\5G\u0316\nG\3H\3H\3H\5H\u031b\nH\3H\3H\5H\u031f\nH\3H\5H\u0322"+ + "\nH\3H\5H\u0325\nH\3H\3H\3H\5H\u032a\nH\3H\5H\u032d\nH\5H\u032f\nH\3I"+ + "\3I\3I\3I\5I\u0335\nI\3I\5I\u0338\nI\3I\3I\5I\u033c\nI\3I\3I\5I\u0340"+ + "\nI\3I\3I\5I\u0344\nI\3J\3J\3J\3J\3J\3J\3J\3J\3J\5J\u034f\nJ\3K\3K\3K"+ + "\5K\u0354\nK\3K\3K\3L\3L\3L\7L\u035b\nL\fL\16L\u035e\13L\3L\3L\3M\3M\3"+ + "M\3M\3M\7M\u0367\nM\fM\16M\u036a\13M\3M\3M\3M\7M\u036f\nM\fM\16M\u0372"+ + "\13M\3M\3M\3M\3M\3N\3N\3N\3N\3N\3O\3O\3P\3P\3Q\3Q\3R\3R\3S\3S\3T\3T\3"+ + "U\3U\3V\3V\3W\3W\3X\3X\3Y\3Y\3Z\3Z\3[\3[\3\\\3\\\3]\3]\3^\3^\3_\3_\3_"+ + "\3`\3`\3`\3a\3a\3a\3b\3b\3b\3c\3c\3c\3d\3d\3d\3e\3e\3e\3f\3f\3f\3g\3g"+ + "\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3o\3o\3o\3p\3p\3p\3q\3q\3q"+ + "\3r\3r\3r\3s\3s\3s\3t\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3w\3x\3x\3x\3x"+ + "\3y\3y\3y\3y\3y\3z\3z\3z\3{\3{\3{\3|\3|\3}\3}\3}\3}\3~\6~\u03f7\n~\r~"+ + "\16~\u03f8\3~\3~\3\177\3\177\3\177\3\177\7\177\u0401\n\177\f\177\16\177"+ + "\u0404\13\177\3\177\3\177\3\177\3\177\3\177\3\u0080\3\u0080\3\u0080\3"+ + "\u0080\7\u0080\u040f\n\u0080\f\u0080\16\u0080\u0412\13\u0080\3\u0080\3"+ + "\u0080\3\u0081\3\u0081\7\u0081\u0418\n\u0081\f\u0081\16\u0081\u041b\13"+ + "\u0081\3\u0082\3\u0082\5\u0082\u041f\n\u0082\3\u0082\3\u0082\3\u0083\3"+ + "\u0083\3\u0083\3\u0083\5\u0083\u0427\n\u0083\3\u0083\5\u0083\u042a\n\u0083"+ + "\3\u0083\3\u0083\3\u0083\6\u0083\u042f\n\u0083\r\u0083\16\u0083\u0430"+ + "\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\5\u0083\u0438\n\u0083\3\u0084"+ + "\3\u0084\3\u0084\7\u0084\u043d\n\u0084\f\u0084\16\u0084\u0440\13\u0084"+ + "\3\u0084\5\u0084\u0443\n\u0084\3\u0085\3\u0085\3\u0086\3\u0086\7\u0086"+ + "\u0449\n\u0086\f\u0086\16\u0086\u044c\13\u0086\3\u0086\5\u0086\u044f\n"+ + "\u0086\3\u0087\3\u0087\5\u0087\u0453\n\u0087\3\u0088\3\u0088\3\u0088\3"+ + "\u0088\5\u0088\u0459\n\u0088\4\u0370\u0402\2\u0089\3\3\5\4\7\5\t\6\13"+ + "\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'"+ + "\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'"+ + "M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u{?}@\177"+ + "A\u0081B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091J\u0093"+ + "K\u0095L\u0097M\u0099N\u009bO\u009dP\u009fQ\u00a1R\u00a3S\u00a5T\u00a7"+ + "U\u00a9V\u00abW\u00adX\u00afY\u00b1Z\u00b3[\u00b5\\\u00b7]\u00b9^\u00bb"+ + "_\u00bd`\u00bfa\u00c1b\u00c3c\u00c5d\u00c7e\u00c9f\u00cbg\u00cdh\u00cf"+ + "i\u00d1j\u00d3k\u00d5l\u00d7m\u00d9n\u00dbo\u00ddp\u00dfq\u00e1r\u00e3"+ + "s\u00e5t\u00e7u\u00e9v\u00ebw\u00edx\u00efy\u00f1z\u00f3{\u00f5|\u00f7"+ + "}\u00f9~\u00fb\177\u00fd\u0080\u00ff\u0081\u0101\u0082\u0103\2\u0105\2"+ + "\u0107\2\u0109\2\u010b\2\u010d\2\u010f\2\3\2\35\3\2\63;\4\2NNnn\4\2ZZ"+ + "zz\5\2\62;CHch\6\2\62;CHaach\3\2\629\4\2\629aa\4\2DDdd\3\2\62\63\4\2\62"+ + "\63aa\6\2FFHHffhh\4\2RRrr\4\2--//\6\2\f\f\17\17))^^\6\2\f\f\17\17$$^^"+ + "\4\2\13\13\"\"\4\2\f\f\17\17\5\2\13\f\16\17\"\"\4\2GGgg\n\2$$))^^ddhh"+ + "ppttvv\3\2\62\65\3\2\62;\4\2\62;aa\6\2&&C\\aac|\4\2\2\u0081\ud802\udc01"+ + "\3\2\ud802\udc01\3\2\udc02\ue001\2\u0486\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3"+ + "\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2"+ + "\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35"+ + "\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)"+ + "\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2"+ + "\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2"+ + "A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3"+ + "\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2"+ + "\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2"+ + "g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3"+ + "\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3"+ + "\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2"+ + "\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2\2\2\u008f\3\2\2\2\2\u0091"+ + "\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099\3\2\2"+ + "\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3"+ + "\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab\3\2\2"+ + "\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3\3\2\2\2\2\u00b5"+ + "\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2\2\2\u00bd\3\2\2"+ + "\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2\2\2\u00c7"+ + "\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2"+ + "\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9"+ + "\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2"+ + "\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb"+ + "\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2"+ + "\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd"+ + "\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\3\u0111\3\2\2\2\5\u011a\3\2\2"+ + "\2\7\u0121\3\2\2\2\t\u0129\3\2\2\2\13\u012f\3\2\2\2\r\u0134\3\2\2\2\17"+ + "\u0139\3\2\2\2\21\u013f\3\2\2\2\23\u0144\3\2\2\2\25\u014a\3\2\2\2\27\u0150"+ + "\3\2\2\2\31\u0159\3\2\2\2\33\u0161\3\2\2\2\35\u0164\3\2\2\2\37\u016b\3"+ + "\2\2\2!\u0170\3\2\2\2#\u0175\3\2\2\2%\u017d\3\2\2\2\'\u0183\3\2\2\2)\u018b"+ + "\3\2\2\2+\u0191\3\2\2\2-\u0195\3\2\2\2/\u0198\3\2\2\2\61\u019d\3\2\2\2"+ + "\63\u01a8\3\2\2\2\65\u01af\3\2\2\2\67\u01ba\3\2\2\29\u01be\3\2\2\2;\u01c8"+ + "\3\2\2\2=\u01cd\3\2\2\2?\u01d4\3\2\2\2A\u01d8\3\2\2\2C\u01e0\3\2\2\2E"+ + "\u01e8\3\2\2\2G\u01f2\3\2\2\2I\u01f9\3\2\2\2K\u0200\3\2\2\2M\u0206\3\2"+ + "\2\2O\u020d\3\2\2\2Q\u0216\3\2\2\2S\u021c\3\2\2\2U\u0223\3\2\2\2W\u0230"+ + "\3\2\2\2Y\u0235\3\2\2\2[\u023b\3\2\2\2]\u0242\3\2\2\2_\u024c\3\2\2\2a"+ + "\u0250\3\2\2\2c\u0255\3\2\2\2e\u025e\3\2\2\2g\u0264\3\2\2\2i\u026b\3\2"+ + "\2\2k\u0270\3\2\2\2m\u0279\3\2\2\2o\u0281\3\2\2\2q\u0287\3\2\2\2s\u028a"+ + "\3\2\2\2u\u028f\3\2\2\2w\u0298\3\2\2\2y\u029d\3\2\2\2{\u02a8\3\2\2\2}"+ + "\u02ac\3\2\2\2\177\u02b2\3\2\2\2\u0081\u02b9\3\2\2\2\u0083\u02c0\3\2\2"+ + "\2\u0085\u02c8\3\2\2\2\u0087\u02e0\3\2\2\2\u0089\u02e5\3\2\2\2\u008b\u02f4"+ + "\3\2\2\2\u008d\u0308\3\2\2\2\u008f\u032e\3\2\2\2\u0091\u0330\3\2\2\2\u0093"+ + "\u034e\3\2\2\2\u0095\u0350\3\2\2\2\u0097\u0357\3\2\2\2\u0099\u0361\3\2"+ + "\2\2\u009b\u0377\3\2\2\2\u009d\u037c\3\2\2\2\u009f\u037e\3\2\2\2\u00a1"+ + "\u0380\3\2\2\2\u00a3\u0382\3\2\2\2\u00a5\u0384\3\2\2\2\u00a7\u0386\3\2"+ + "\2\2\u00a9\u0388\3\2\2\2\u00ab\u038a\3\2\2\2\u00ad\u038c\3\2\2\2\u00af"+ + "\u038e\3\2\2\2\u00b1\u0390\3\2\2\2\u00b3\u0392\3\2\2\2\u00b5\u0394\3\2"+ + "\2\2\u00b7\u0396\3\2\2\2\u00b9\u0398\3\2\2\2\u00bb\u039a\3\2\2\2\u00bd"+ + "\u039c\3\2\2\2\u00bf\u039f\3\2\2\2\u00c1\u03a2\3\2\2\2\u00c3\u03a5\3\2"+ + "\2\2\u00c5\u03a8\3\2\2\2\u00c7\u03ab\3\2\2\2\u00c9\u03ae\3\2\2\2\u00cb"+ + "\u03b1\3\2\2\2\u00cd\u03b4\3\2\2\2\u00cf\u03b6\3\2\2\2\u00d1\u03b8\3\2"+ + "\2\2\u00d3\u03ba\3\2\2\2\u00d5\u03bc\3\2\2\2\u00d7\u03be\3\2\2\2\u00d9"+ + "\u03c0\3\2\2\2\u00db\u03c2\3\2\2\2\u00dd\u03c4\3\2\2\2\u00df\u03c7\3\2"+ + "\2\2\u00e1\u03ca\3\2\2\2\u00e3\u03cd\3\2\2\2\u00e5\u03d0\3\2\2\2\u00e7"+ + "\u03d3\3\2\2\2\u00e9\u03d6\3\2\2\2\u00eb\u03d9\3\2\2\2\u00ed\u03dc\3\2"+ + "\2\2\u00ef\u03e0\3\2\2\2\u00f1\u03e4\3\2\2\2\u00f3\u03e9\3\2\2\2\u00f5"+ + "\u03ec\3\2\2\2\u00f7\u03ef\3\2\2\2\u00f9\u03f1\3\2\2\2\u00fb\u03f6\3\2"+ + "\2\2\u00fd\u03fc\3\2\2\2\u00ff\u040a\3\2\2\2\u0101\u0415\3\2\2\2\u0103"+ + "\u041c\3\2\2\2\u0105\u0437\3\2\2\2\u0107\u0439\3\2\2\2\u0109\u0444\3\2"+ + "\2\2\u010b\u0446\3\2\2\2\u010d\u0452\3\2\2\2\u010f\u0458\3\2\2\2\u0111"+ + "\u0112\7c\2\2\u0112\u0113\7d\2\2\u0113\u0114\7u\2\2\u0114\u0115\7v\2\2"+ + "\u0115\u0116\7t\2\2\u0116\u0117\7c\2\2\u0117\u0118\7e\2\2\u0118\u0119"+ + "\7v\2\2\u0119\4\3\2\2\2\u011a\u011b\7c\2\2\u011b\u011c\7u\2\2\u011c\u011d"+ + "\7u\2\2\u011d\u011e\7g\2\2\u011e\u011f\7t\2\2\u011f\u0120\7v\2\2\u0120"+ + "\6\3\2\2\2\u0121\u0122\7d\2\2\u0122\u0123\7q\2\2\u0123\u0124\7q\2\2\u0124"+ + "\u0125\7n\2\2\u0125\u0126\7g\2\2\u0126\u0127\7c\2\2\u0127\u0128\7p\2\2"+ + "\u0128\b\3\2\2\2\u0129\u012a\7d\2\2\u012a\u012b\7t\2\2\u012b\u012c\7g"+ + "\2\2\u012c\u012d\7c\2\2\u012d\u012e\7m\2\2\u012e\n\3\2\2\2\u012f\u0130"+ + "\7d\2\2\u0130\u0131\7{\2\2\u0131\u0132\7v\2\2\u0132\u0133\7g\2\2\u0133"+ + "\f\3\2\2\2\u0134\u0135\7e\2\2\u0135\u0136\7c\2\2\u0136\u0137\7u\2\2\u0137"+ + "\u0138\7g\2\2\u0138\16\3\2\2\2\u0139\u013a\7e\2\2\u013a\u013b\7c\2\2\u013b"+ + "\u013c\7v\2\2\u013c\u013d\7e\2\2\u013d\u013e\7j\2\2\u013e\20\3\2\2\2\u013f"+ + "\u0140\7e\2\2\u0140\u0141\7j\2\2\u0141\u0142\7c\2\2\u0142\u0143\7t\2\2"+ + "\u0143\22\3\2\2\2\u0144\u0145\7e\2\2\u0145\u0146\7n\2\2\u0146\u0147\7"+ + "c\2\2\u0147\u0148\7u\2\2\u0148\u0149\7u\2\2\u0149\24\3\2\2\2\u014a\u014b"+ + "\7e\2\2\u014b\u014c\7q\2\2\u014c\u014d\7p\2\2\u014d\u014e\7u\2\2\u014e"+ + "\u014f\7v\2\2\u014f\26\3\2\2\2\u0150\u0151\7e\2\2\u0151\u0152\7q\2\2\u0152"+ + "\u0153\7p\2\2\u0153\u0154\7v\2\2\u0154\u0155\7k\2\2\u0155\u0156\7p\2\2"+ + "\u0156\u0157\7w\2\2\u0157\u0158\7g\2\2\u0158\30\3\2\2\2\u0159\u015a\7"+ + "f\2\2\u015a\u015b\7g\2\2\u015b\u015c\7h\2\2\u015c\u015d\7c\2\2\u015d\u015e"+ + "\7w\2\2\u015e\u015f\7n\2\2\u015f\u0160\7v\2\2\u0160\32\3\2\2\2\u0161\u0162"+ + "\7f\2\2\u0162\u0163\7q\2\2\u0163\34\3\2\2\2\u0164\u0165\7f\2\2\u0165\u0166"+ + "\7q\2\2\u0166\u0167\7w\2\2\u0167\u0168\7d\2\2\u0168\u0169\7n\2\2\u0169"+ + "\u016a\7g\2\2\u016a\36\3\2\2\2\u016b\u016c\7g\2\2\u016c\u016d\7n\2\2\u016d"+ + "\u016e\7u\2\2\u016e\u016f\7g\2\2\u016f \3\2\2\2\u0170\u0171\7g\2\2\u0171"+ + "\u0172\7p\2\2\u0172\u0173\7w\2\2\u0173\u0174\7o\2\2\u0174\"\3\2\2\2\u0175"+ + "\u0176\7g\2\2\u0176\u0177\7z\2\2\u0177\u0178\7v\2\2\u0178\u0179\7g\2\2"+ + "\u0179\u017a\7p\2\2\u017a\u017b\7f\2\2\u017b\u017c\7u\2\2\u017c$\3\2\2"+ + "\2\u017d\u017e\7h\2\2\u017e\u017f\7k\2\2\u017f\u0180\7p\2\2\u0180\u0181"+ + "\7c\2\2\u0181\u0182\7n\2\2\u0182&\3\2\2\2\u0183\u0184\7h\2\2\u0184\u0185"+ + "\7k\2\2\u0185\u0186\7p\2\2\u0186\u0187\7c\2\2\u0187\u0188\7n\2\2\u0188"+ + "\u0189\7n\2\2\u0189\u018a\7{\2\2\u018a(\3\2\2\2\u018b\u018c\7h\2\2\u018c"+ + "\u018d\7n\2\2\u018d\u018e\7q\2\2\u018e\u018f\7c\2\2\u018f\u0190\7v\2\2"+ + "\u0190*\3\2\2\2\u0191\u0192\7h\2\2\u0192\u0193\7q\2\2\u0193\u0194\7t\2"+ + "\2\u0194,\3\2\2\2\u0195\u0196\7k\2\2\u0196\u0197\7h\2\2\u0197.\3\2\2\2"+ + "\u0198\u0199\7i\2\2\u0199\u019a\7q\2\2\u019a\u019b\7v\2\2\u019b\u019c"+ + "\7q\2\2\u019c\60\3\2\2\2\u019d\u019e\7k\2\2\u019e\u019f\7o\2\2\u019f\u01a0"+ + "\7r\2\2\u01a0\u01a1\7n\2\2\u01a1\u01a2\7g\2\2\u01a2\u01a3\7o\2\2\u01a3"+ + "\u01a4\7g\2\2\u01a4\u01a5\7p\2\2\u01a5\u01a6\7v\2\2\u01a6\u01a7\7u\2\2"+ + "\u01a7\62\3\2\2\2\u01a8\u01a9\7k\2\2\u01a9\u01aa\7o\2\2\u01aa\u01ab\7"+ + "r\2\2\u01ab\u01ac\7q\2\2\u01ac\u01ad\7t\2\2\u01ad\u01ae\7v\2\2\u01ae\64"+ + "\3\2\2\2\u01af\u01b0\7k\2\2\u01b0\u01b1\7p\2\2\u01b1\u01b2\7u\2\2\u01b2"+ + "\u01b3\7v\2\2\u01b3\u01b4\7c\2\2\u01b4\u01b5\7p\2\2\u01b5\u01b6\7e\2\2"+ + "\u01b6\u01b7\7g\2\2\u01b7\u01b8\7q\2\2\u01b8\u01b9\7h\2\2\u01b9\66\3\2"+ + "\2\2\u01ba\u01bb\7k\2\2\u01bb\u01bc\7p\2\2\u01bc\u01bd\7v\2\2\u01bd8\3"+ + "\2\2\2\u01be\u01bf\7k\2\2\u01bf\u01c0\7p\2\2\u01c0\u01c1\7v\2\2\u01c1"+ + "\u01c2\7g\2\2\u01c2\u01c3\7t\2\2\u01c3\u01c4\7h\2\2\u01c4\u01c5\7c\2\2"+ + "\u01c5\u01c6\7e\2\2\u01c6\u01c7\7g\2\2\u01c7:\3\2\2\2\u01c8\u01c9\7n\2"+ + "\2\u01c9\u01ca\7q\2\2\u01ca\u01cb\7p\2\2\u01cb\u01cc\7i\2\2\u01cc<\3\2"+ + "\2\2\u01cd\u01ce\7p\2\2\u01ce\u01cf\7c\2\2\u01cf\u01d0\7v\2\2\u01d0\u01d1"+ + "\7k\2\2\u01d1\u01d2\7x\2\2\u01d2\u01d3\7g\2\2\u01d3>\3\2\2\2\u01d4\u01d5"+ + "\7p\2\2\u01d5\u01d6\7g\2\2\u01d6\u01d7\7y\2\2\u01d7@\3\2\2\2\u01d8\u01d9"+ + "\7r\2\2\u01d9\u01da\7c\2\2\u01da\u01db\7e\2\2\u01db\u01dc\7m\2\2\u01dc"+ + "\u01dd\7c\2\2\u01dd\u01de\7i\2\2\u01de\u01df\7g\2\2\u01dfB\3\2\2\2\u01e0"+ + "\u01e1\7r\2\2\u01e1\u01e2\7t\2\2\u01e2\u01e3\7k\2\2\u01e3\u01e4\7x\2\2"+ + "\u01e4\u01e5\7c\2\2\u01e5\u01e6\7v\2\2\u01e6\u01e7\7g\2\2\u01e7D\3\2\2"+ + "\2\u01e8\u01e9\7r\2\2\u01e9\u01ea\7t\2\2\u01ea\u01eb\7q\2\2\u01eb\u01ec"+ + "\7v\2\2\u01ec\u01ed\7g\2\2\u01ed\u01ee\7e\2\2\u01ee\u01ef\7v\2\2\u01ef"+ + "\u01f0\7g\2\2\u01f0\u01f1\7f\2\2\u01f1F\3\2\2\2\u01f2\u01f3\7r\2\2\u01f3"+ + "\u01f4\7w\2\2\u01f4\u01f5\7d\2\2\u01f5\u01f6\7n\2\2\u01f6\u01f7\7k\2\2"+ + "\u01f7\u01f8\7e\2\2\u01f8H\3\2\2\2\u01f9\u01fa\7t\2\2\u01fa\u01fb\7g\2"+ + "\2\u01fb\u01fc\7v\2\2\u01fc\u01fd\7w\2\2\u01fd\u01fe\7t\2\2\u01fe\u01ff"+ + "\7p\2\2\u01ffJ\3\2\2\2\u0200\u0201\7u\2\2\u0201\u0202\7j\2\2\u0202\u0203"+ + "\7q\2\2\u0203\u0204\7t\2\2\u0204\u0205\7v\2\2\u0205L\3\2\2\2\u0206\u0207"+ + "\7u\2\2\u0207\u0208\7v\2\2\u0208\u0209\7c\2\2\u0209\u020a\7v\2\2\u020a"+ + "\u020b\7k\2\2\u020b\u020c\7e\2\2\u020cN\3\2\2\2\u020d\u020e\7u\2\2\u020e"+ + "\u020f\7v\2\2\u020f\u0210\7t\2\2\u0210\u0211\7k\2\2\u0211\u0212\7e\2\2"+ + "\u0212\u0213\7v\2\2\u0213\u0214\7h\2\2\u0214\u0215\7r\2\2\u0215P\3\2\2"+ + "\2\u0216\u0217\7u\2\2\u0217\u0218\7w\2\2\u0218\u0219\7r\2\2\u0219\u021a"+ + "\7g\2\2\u021a\u021b\7t\2\2\u021bR\3\2\2\2\u021c\u021d\7u\2\2\u021d\u021e"+ + "\7y\2\2\u021e\u021f\7k\2\2\u021f\u0220\7v\2\2\u0220\u0221\7e\2\2\u0221"+ + "\u0222\7j\2\2\u0222T\3\2\2\2\u0223\u0224\7u\2\2\u0224\u0225\7{\2\2\u0225"+ + "\u0226\7p\2\2\u0226\u0227\7e\2\2\u0227\u0228\7j\2\2\u0228\u0229\7t\2\2"+ + "\u0229\u022a\7q\2\2\u022a\u022b\7p\2\2\u022b\u022c\7k\2\2\u022c\u022d"+ + "\7|\2\2\u022d\u022e\7g\2\2\u022e\u022f\7f\2\2\u022fV\3\2\2\2\u0230\u0231"+ + "\7v\2\2\u0231\u0232\7j\2\2\u0232\u0233\7k\2\2\u0233\u0234\7u\2\2\u0234"+ + "X\3\2\2\2\u0235\u0236\7v\2\2\u0236\u0237\7j\2\2\u0237\u0238\7t\2\2\u0238"+ + "\u0239\7q\2\2\u0239\u023a\7y\2\2\u023aZ\3\2\2\2\u023b\u023c\7v\2\2\u023c"+ + "\u023d\7j\2\2\u023d\u023e\7t\2\2\u023e\u023f\7q\2\2\u023f\u0240\7y\2\2"+ + "\u0240\u0241\7u\2\2\u0241\\\3\2\2\2\u0242\u0243\7v\2\2\u0243\u0244\7t"+ + "\2\2\u0244\u0245\7c\2\2\u0245\u0246\7p\2\2\u0246\u0247\7u\2\2\u0247\u0248"+ + "\7k\2\2\u0248\u0249\7g\2\2\u0249\u024a\7p\2\2\u024a\u024b\7v\2\2\u024b"+ + "^\3\2\2\2\u024c\u024d\7v\2\2\u024d\u024e\7t\2\2\u024e\u024f\7{\2\2\u024f"+ + "`\3\2\2\2\u0250\u0251\7x\2\2\u0251\u0252\7q\2\2\u0252\u0253\7k\2\2\u0253"+ + "\u0254\7f\2\2\u0254b\3\2\2\2\u0255\u0256\7x\2\2\u0256\u0257\7q\2\2\u0257"+ + "\u0258\7n\2\2\u0258\u0259\7c\2\2\u0259\u025a\7v\2\2\u025a\u025b\7k\2\2"+ + "\u025b\u025c\7n\2\2\u025c\u025d\7g\2\2\u025dd\3\2\2\2\u025e\u025f\7y\2"+ + "\2\u025f\u0260\7j\2\2\u0260\u0261\7k\2\2\u0261\u0262\7n\2\2\u0262\u0263"+ + "\7g\2\2\u0263f\3\2\2\2\u0264\u0265\7o\2\2\u0265\u0266\7q\2\2\u0266\u0267"+ + "\7f\2\2\u0267\u0268\7w\2\2\u0268\u0269\7n\2\2\u0269\u026a\7g\2\2\u026a"+ + "h\3\2\2\2\u026b\u026c\7q\2\2\u026c\u026d\7r\2\2\u026d\u026e\7g\2\2\u026e"+ + "\u026f\7p\2\2\u026fj\3\2\2\2\u0270\u0271\7t\2\2\u0271\u0272\7g\2\2\u0272"+ + "\u0273\7s\2\2\u0273\u0274\7w\2\2\u0274\u0275\7k\2\2\u0275\u0276\7t\2\2"+ + "\u0276\u0277\7g\2\2\u0277\u0278\7u\2\2\u0278l\3\2\2\2\u0279\u027a\7g\2"+ + "\2\u027a\u027b\7z\2\2\u027b\u027c\7r\2\2\u027c\u027d\7q\2\2\u027d\u027e"+ + "\7t\2\2\u027e\u027f\7v\2\2\u027f\u0280\7u\2\2\u0280n\3\2\2\2\u0281\u0282"+ + "\7q\2\2\u0282\u0283\7r\2\2\u0283\u0284\7g\2\2\u0284\u0285\7p\2\2\u0285"+ + "\u0286\7u\2\2\u0286p\3\2\2\2\u0287\u0288\7v\2\2\u0288\u0289\7q\2\2\u0289"+ + "r\3\2\2\2\u028a\u028b\7w\2\2\u028b\u028c\7u\2\2\u028c\u028d\7g\2\2\u028d"+ + "\u028e\7u\2\2\u028et\3\2\2\2\u028f\u0290\7r\2\2\u0290\u0291\7t\2\2\u0291"+ + "\u0292\7q\2\2\u0292\u0293\7x\2\2\u0293\u0294\7k\2\2\u0294\u0295\7f\2\2"+ + "\u0295\u0296\7g\2\2\u0296\u0297\7u\2\2\u0297v\3\2\2\2\u0298\u0299\7y\2"+ + "\2\u0299\u029a\7k\2\2\u029a\u029b\7v\2\2\u029b\u029c\7j\2\2\u029cx\3\2"+ + "\2\2\u029d\u029e\7v\2\2\u029e\u029f\7t\2\2\u029f\u02a0\7c\2\2\u02a0\u02a1"+ + "\7p\2\2\u02a1\u02a2\7u\2\2\u02a2\u02a3\7k\2\2\u02a3\u02a4\7v\2\2\u02a4"+ + "\u02a5\7k\2\2\u02a5\u02a6\7x\2\2\u02a6\u02a7\7g\2\2\u02a7z\3\2\2\2\u02a8"+ + "\u02a9\7x\2\2\u02a9\u02aa\7c\2\2\u02aa\u02ab\7t\2\2\u02ab|\3\2\2\2\u02ac"+ + "\u02ad\7{\2\2\u02ad\u02ae\7k\2\2\u02ae\u02af\7g\2\2\u02af\u02b0\7n\2\2"+ + "\u02b0\u02b1\7f\2\2\u02b1~\3\2\2\2\u02b2\u02b3\7t\2\2\u02b3\u02b4\7g\2"+ + "\2\u02b4\u02b5\7e\2\2\u02b5\u02b6\7q\2\2\u02b6\u02b7\7t\2\2\u02b7\u02b8"+ + "\7f\2\2\u02b8\u0080\3\2\2\2\u02b9\u02ba\7u\2\2\u02ba\u02bb\7g\2\2\u02bb"+ + "\u02bc\7c\2\2\u02bc\u02bd\7n\2\2\u02bd\u02be\7g\2\2\u02be\u02bf\7f\2\2"+ + "\u02bf\u0082\3\2\2\2\u02c0\u02c1\7r\2\2\u02c1\u02c2\7g\2\2\u02c2\u02c3"+ + "\7t\2\2\u02c3\u02c4\7o\2\2\u02c4\u02c5\7k\2\2\u02c5\u02c6\7v\2\2\u02c6"+ + "\u02c7\7u\2\2\u02c7\u0084\3\2\2\2\u02c8\u02c9\7p\2\2\u02c9\u02ca\7q\2"+ + "\2\u02ca\u02cb\7p\2\2\u02cb\u02cc\7/\2\2\u02cc\u02cd\7u\2\2\u02cd\u02ce"+ + "\7g\2\2\u02ce\u02cf\7c\2\2\u02cf\u02d0\7n\2\2\u02d0\u02d1\7g\2\2\u02d1"+ + "\u02d2\7f\2\2\u02d2\u0086\3\2\2\2\u02d3\u02e1\7\62\2\2\u02d4\u02de\t\2"+ + "\2\2\u02d5\u02d7\5\u010b\u0086\2\u02d6\u02d5\3\2\2\2\u02d6\u02d7\3\2\2"+ + "\2\u02d7\u02df\3\2\2\2\u02d8\u02da\7a\2\2\u02d9\u02d8\3\2\2\2\u02da\u02db"+ + "\3\2\2\2\u02db\u02d9\3\2\2\2\u02db\u02dc\3\2\2\2\u02dc\u02dd\3\2\2\2\u02dd"+ + "\u02df\5\u010b\u0086\2\u02de\u02d6\3\2\2\2\u02de\u02d9\3\2\2\2\u02df\u02e1"+ + "\3\2\2\2\u02e0\u02d3\3\2\2\2\u02e0\u02d4\3\2\2\2\u02e1\u02e3\3\2\2\2\u02e2"+ + "\u02e4\t\3\2\2\u02e3\u02e2\3\2\2\2\u02e3\u02e4\3\2\2\2\u02e4\u0088\3\2"+ + "\2\2\u02e5\u02e6\7\62\2\2\u02e6\u02e7\t\4\2\2\u02e7\u02ef\t\5\2\2\u02e8"+ + "\u02ea\t\6\2\2\u02e9\u02e8\3\2\2\2\u02ea\u02ed\3\2\2\2\u02eb\u02e9\3\2"+ + "\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ee\3\2\2\2\u02ed\u02eb\3\2\2\2\u02ee"+ + "\u02f0\t\5\2\2\u02ef\u02eb\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0\u02f2\3\2"+ + "\2\2\u02f1\u02f3\t\3\2\2\u02f2\u02f1\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3"+ + "\u008a\3\2\2\2\u02f4\u02f8\7\62\2\2\u02f5\u02f7\7a\2\2\u02f6\u02f5\3\2"+ + "\2\2\u02f7\u02fa\3\2\2\2\u02f8\u02f6\3\2\2\2\u02f8\u02f9\3\2\2\2\u02f9"+ + "\u02fb\3\2\2\2\u02fa\u02f8\3\2\2\2\u02fb\u0303\t\7\2\2\u02fc\u02fe\t\b"+ + "\2\2\u02fd\u02fc\3\2\2\2\u02fe\u0301\3\2\2\2\u02ff\u02fd\3\2\2\2\u02ff"+ + "\u0300\3\2\2\2\u0300\u0302\3\2\2\2\u0301\u02ff\3\2\2\2\u0302\u0304\t\7"+ + "\2\2\u0303\u02ff\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u0306\3\2\2\2\u0305"+ + "\u0307\t\3\2\2\u0306\u0305\3\2\2\2\u0306\u0307\3\2\2\2\u0307\u008c\3\2"+ + "\2\2\u0308\u0309\7\62\2\2\u0309\u030a\t\t\2\2\u030a\u0312\t\n\2\2\u030b"+ + "\u030d\t\13\2\2\u030c\u030b\3\2\2\2\u030d\u0310\3\2\2\2\u030e\u030c\3"+ + "\2\2\2\u030e\u030f\3\2\2\2\u030f\u0311\3\2\2\2\u0310\u030e\3\2\2\2\u0311"+ + "\u0313\t\n\2\2\u0312\u030e\3\2\2\2\u0312\u0313\3\2\2\2\u0313\u0315\3\2"+ + "\2\2\u0314\u0316\t\3\2\2\u0315\u0314\3\2\2\2\u0315\u0316\3\2\2\2\u0316"+ + "\u008e\3\2\2\2\u0317\u0318\5\u010b\u0086\2\u0318\u031a\7\60\2\2\u0319"+ + "\u031b\5\u010b\u0086\2\u031a\u0319\3\2\2\2\u031a\u031b\3\2\2\2\u031b\u031f"+ + "\3\2\2\2\u031c\u031d\7\60\2\2\u031d\u031f\5\u010b\u0086\2\u031e\u0317"+ + "\3\2\2\2\u031e\u031c\3\2\2\2\u031f\u0321\3\2\2\2\u0320\u0322\5\u0103\u0082"+ + "\2\u0321\u0320\3\2\2\2\u0321\u0322\3\2\2\2\u0322\u0324\3\2\2\2\u0323\u0325"+ + "\t\f\2\2\u0324\u0323\3\2\2\2\u0324\u0325\3\2\2\2\u0325\u032f\3\2\2\2\u0326"+ + "\u032c\5\u010b\u0086\2\u0327\u0329\5\u0103\u0082\2\u0328\u032a\t\f\2\2"+ + "\u0329\u0328\3\2\2\2\u0329\u032a\3\2\2\2\u032a\u032d\3\2\2\2\u032b\u032d"+ + "\t\f\2\2\u032c\u0327\3\2\2\2\u032c\u032b\3\2\2\2\u032d\u032f\3\2\2\2\u032e"+ + "\u031e\3\2\2\2\u032e\u0326\3\2\2\2\u032f\u0090\3\2\2\2\u0330\u0331\7\62"+ + "\2\2\u0331\u033b\t\4\2\2\u0332\u0334\5\u0107\u0084\2\u0333\u0335\7\60"+ + "\2\2\u0334\u0333\3\2\2\2\u0334\u0335\3\2\2\2\u0335\u033c\3\2\2\2\u0336"+ + "\u0338\5\u0107\u0084\2\u0337\u0336\3\2\2\2\u0337\u0338\3\2\2\2\u0338\u0339"+ + "\3\2\2\2\u0339\u033a\7\60\2\2\u033a\u033c\5\u0107\u0084\2\u033b\u0332"+ + "\3\2\2\2\u033b\u0337\3\2\2\2\u033c\u033d\3\2\2\2\u033d\u033f\t\r\2\2\u033e"+ + "\u0340\t\16\2\2\u033f\u033e\3\2\2\2\u033f\u0340\3\2\2\2\u0340\u0341\3"+ + "\2\2\2\u0341\u0343\5\u010b\u0086\2\u0342\u0344\t\f\2\2\u0343\u0342\3\2"+ + "\2\2\u0343\u0344\3\2\2\2\u0344\u0092\3\2\2\2\u0345\u0346\7v\2\2\u0346"+ + "\u0347\7t\2\2\u0347\u0348\7w\2\2\u0348\u034f\7g\2\2\u0349\u034a\7h\2\2"+ + "\u034a\u034b\7c\2\2\u034b\u034c\7n\2\2\u034c\u034d\7u\2\2\u034d\u034f"+ + "\7g\2\2\u034e\u0345\3\2\2\2\u034e\u0349\3\2\2\2\u034f\u0094\3\2\2\2\u0350"+ + "\u0353\7)\2\2\u0351\u0354\n\17\2\2\u0352\u0354\5\u0105\u0083\2\u0353\u0351"+ + "\3\2\2\2\u0353\u0352\3\2\2\2\u0354\u0355\3\2\2\2\u0355\u0356\7)\2\2\u0356"+ + "\u0096\3\2\2\2\u0357\u035c\7$\2\2\u0358\u035b\n\20\2\2\u0359\u035b\5\u0105"+ + "\u0083\2\u035a\u0358\3\2\2\2\u035a\u0359\3\2\2\2\u035b\u035e\3\2\2\2\u035c"+ + "\u035a\3\2\2\2\u035c\u035d\3\2\2\2\u035d\u035f\3\2\2\2\u035e\u035c\3\2"+ + "\2\2\u035f\u0360\7$\2\2\u0360\u0098\3\2\2\2\u0361\u0362\7$\2\2\u0362\u0363"+ + "\7$\2\2\u0363\u0364\7$\2\2\u0364\u0368\3\2\2\2\u0365\u0367\t\21\2\2\u0366"+ + "\u0365\3\2\2\2\u0367\u036a\3\2\2\2\u0368\u0366\3\2\2\2\u0368\u0369\3\2"+ + "\2\2\u0369\u036b\3\2\2\2\u036a\u0368\3\2\2\2\u036b\u0370\t\22\2\2\u036c"+ + "\u036f\13\2\2\2\u036d\u036f\5\u0105\u0083\2\u036e\u036c\3\2\2\2\u036e"+ + "\u036d\3\2\2\2\u036f\u0372\3\2\2\2\u0370\u0371\3\2\2\2\u0370\u036e\3\2"+ + "\2\2\u0371\u0373\3\2\2\2\u0372\u0370\3\2\2\2\u0373\u0374\7$\2\2\u0374"+ + "\u0375\7$\2\2\u0375\u0376\7$\2\2\u0376\u009a\3\2\2\2\u0377\u0378\7p\2"+ + "\2\u0378\u0379\7w\2\2\u0379\u037a\7n\2\2\u037a\u037b\7n\2\2\u037b\u009c"+ + "\3\2\2\2\u037c\u037d\7*\2\2\u037d\u009e\3\2\2\2\u037e\u037f\7+\2\2\u037f"+ + "\u00a0\3\2\2\2\u0380\u0381\7}\2\2\u0381\u00a2\3\2\2\2\u0382\u0383\7\177"+ + "\2\2\u0383\u00a4\3\2\2\2\u0384\u0385\7]\2\2\u0385\u00a6\3\2\2\2\u0386"+ + "\u0387\7_\2\2\u0387\u00a8\3\2\2\2\u0388\u0389\7=\2\2\u0389\u00aa\3\2\2"+ + "\2\u038a\u038b\7.\2\2\u038b\u00ac\3\2\2\2\u038c\u038d\7\60\2\2\u038d\u00ae"+ + "\3\2\2\2\u038e\u038f\7?\2\2\u038f\u00b0\3\2\2\2\u0390\u0391\7@\2\2\u0391"+ + "\u00b2\3\2\2\2\u0392\u0393\7>\2\2\u0393\u00b4\3\2\2\2\u0394\u0395\7#\2"+ + "\2\u0395\u00b6\3\2\2\2\u0396\u0397\7\u0080\2\2\u0397\u00b8\3\2\2\2\u0398"+ + "\u0399\7A\2\2\u0399\u00ba\3\2\2\2\u039a\u039b\7<\2\2\u039b\u00bc\3\2\2"+ + "\2\u039c\u039d\7?\2\2\u039d\u039e\7?\2\2\u039e\u00be\3\2\2\2\u039f\u03a0"+ + "\7>\2\2\u03a0\u03a1\7?\2\2\u03a1\u00c0\3\2\2\2\u03a2\u03a3\7@\2\2\u03a3"+ + "\u03a4\7?\2\2\u03a4\u00c2\3\2\2\2\u03a5\u03a6\7#\2\2\u03a6\u03a7\7?\2"+ + "\2\u03a7\u00c4\3\2\2\2\u03a8\u03a9\7(\2\2\u03a9\u03aa\7(\2\2\u03aa\u00c6"+ + "\3\2\2\2\u03ab\u03ac\7~\2\2\u03ac\u03ad\7~\2\2\u03ad\u00c8\3\2\2\2\u03ae"+ + "\u03af\7-\2\2\u03af\u03b0\7-\2\2\u03b0\u00ca\3\2\2\2\u03b1\u03b2\7/\2"+ + "\2\u03b2\u03b3\7/\2\2\u03b3\u00cc\3\2\2\2\u03b4\u03b5\7-\2\2\u03b5\u00ce"+ + "\3\2\2\2\u03b6\u03b7\7/\2\2\u03b7\u00d0\3\2\2\2\u03b8\u03b9\7,\2\2\u03b9"+ + "\u00d2\3\2\2\2\u03ba\u03bb\7\61\2\2\u03bb\u00d4\3\2\2\2\u03bc\u03bd\7"+ + "(\2\2\u03bd\u00d6\3\2\2\2\u03be\u03bf\7~\2\2\u03bf\u00d8\3\2\2\2\u03c0"+ + "\u03c1\7`\2\2\u03c1\u00da\3\2\2\2\u03c2\u03c3\7\'\2\2\u03c3\u00dc\3\2"+ + "\2\2\u03c4\u03c5\7-\2\2\u03c5\u03c6\7?\2\2\u03c6\u00de\3\2\2\2\u03c7\u03c8"+ + "\7/\2\2\u03c8\u03c9\7?\2\2\u03c9\u00e0\3\2\2\2\u03ca\u03cb\7,\2\2\u03cb"+ + "\u03cc\7?\2\2\u03cc\u00e2\3\2\2\2\u03cd\u03ce\7\61\2\2\u03ce\u03cf\7?"+ + "\2\2\u03cf\u00e4\3\2\2\2\u03d0\u03d1\7(\2\2\u03d1\u03d2\7?\2\2\u03d2\u00e6"+ + "\3\2\2\2\u03d3\u03d4\7~\2\2\u03d4\u03d5\7?\2\2\u03d5\u00e8\3\2\2\2\u03d6"+ + "\u03d7\7`\2\2\u03d7\u03d8\7?\2\2\u03d8\u00ea\3\2\2\2\u03d9\u03da\7\'\2"+ + "\2\u03da\u03db\7?\2\2\u03db\u00ec\3\2\2\2\u03dc\u03dd\7>\2\2\u03dd\u03de"+ + "\7>\2\2\u03de\u03df\7?\2\2\u03df\u00ee\3\2\2\2\u03e0\u03e1\7@\2\2\u03e1"+ + "\u03e2\7@\2\2\u03e2\u03e3\7?\2\2\u03e3\u00f0\3\2\2\2\u03e4\u03e5\7@\2"+ + "\2\u03e5\u03e6\7@\2\2\u03e6\u03e7\7@\2\2\u03e7\u03e8\7?\2\2\u03e8\u00f2"+ + "\3\2\2\2\u03e9\u03ea\7/\2\2\u03ea\u03eb\7@\2\2\u03eb\u00f4\3\2\2\2\u03ec"+ + "\u03ed\7<\2\2\u03ed\u03ee\7<\2\2\u03ee\u00f6\3\2\2\2\u03ef\u03f0\7B\2"+ + "\2\u03f0\u00f8\3\2\2\2\u03f1\u03f2\7\60\2\2\u03f2\u03f3\7\60\2\2\u03f3"+ + "\u03f4\7\60\2\2\u03f4\u00fa\3\2\2\2\u03f5\u03f7\t\23\2\2\u03f6\u03f5\3"+ + "\2\2\2\u03f7\u03f8\3\2\2\2\u03f8\u03f6\3\2\2\2\u03f8\u03f9\3\2\2\2\u03f9"+ + "\u03fa\3\2\2\2\u03fa\u03fb\b~\2\2\u03fb\u00fc\3\2\2\2\u03fc\u03fd\7\61"+ + "\2\2\u03fd\u03fe\7,\2\2\u03fe\u0402\3\2\2\2\u03ff\u0401\13\2\2\2\u0400"+ + "\u03ff\3\2\2\2\u0401\u0404\3\2\2\2\u0402\u0403\3\2\2\2\u0402\u0400\3\2"+ + "\2\2\u0403\u0405\3\2\2\2\u0404\u0402\3\2\2\2\u0405\u0406\7,\2\2\u0406"+ + "\u0407\7\61\2\2\u0407\u0408\3\2\2\2\u0408\u0409\b\177\2\2\u0409\u00fe"+ + "\3\2\2\2\u040a\u040b\7\61\2\2\u040b\u040c\7\61\2\2\u040c\u0410\3\2\2\2"+ + "\u040d\u040f\n\22\2\2\u040e\u040d\3\2\2\2\u040f\u0412\3\2\2\2\u0410\u040e"+ + "\3\2\2\2\u0410\u0411\3\2\2\2\u0411\u0413\3\2\2\2\u0412\u0410\3\2\2\2\u0413"+ + "\u0414\b\u0080\2\2\u0414\u0100\3\2\2\2\u0415\u0419\5\u010f\u0088\2\u0416"+ + "\u0418\5\u010d\u0087\2\u0417\u0416\3\2\2\2\u0418\u041b\3\2\2\2\u0419\u0417"+ + "\3\2\2\2\u0419\u041a\3\2\2\2\u041a\u0102\3\2\2\2\u041b\u0419\3\2\2\2\u041c"+ + "\u041e\t\24\2\2\u041d\u041f\t\16\2\2\u041e\u041d\3\2\2\2\u041e\u041f\3"+ + "\2\2\2\u041f\u0420\3\2\2\2\u0420\u0421\5\u010b\u0086\2\u0421\u0104\3\2"+ + "\2\2\u0422\u0423\7^\2\2\u0423\u0438\t\25\2\2\u0424\u0429\7^\2\2\u0425"+ + "\u0427\t\26\2\2\u0426\u0425\3\2\2\2\u0426\u0427\3\2\2\2\u0427\u0428\3"+ + "\2\2\2\u0428\u042a\t\7\2\2\u0429\u0426\3\2\2\2\u0429\u042a\3\2\2\2\u042a"+ + "\u042b\3\2\2\2\u042b\u0438\t\7\2\2\u042c\u042e\7^\2\2\u042d\u042f\7w\2"+ + "\2\u042e\u042d\3\2\2\2\u042f\u0430\3\2\2\2\u0430\u042e\3\2\2\2\u0430\u0431"+ + "\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\5\u0109\u0085\2\u0433\u0434\5"+ + "\u0109\u0085\2\u0434\u0435\5\u0109\u0085\2\u0435\u0436\5\u0109\u0085\2"+ + "\u0436\u0438\3\2\2\2\u0437\u0422\3\2\2\2\u0437\u0424\3\2\2\2\u0437\u042c"+ + "\3\2\2\2\u0438\u0106\3\2\2\2\u0439\u0442\5\u0109\u0085\2\u043a\u043d\5"+ + "\u0109\u0085\2\u043b\u043d\7a\2\2\u043c\u043a\3\2\2\2\u043c\u043b\3\2"+ + "\2\2\u043d\u0440\3\2\2\2\u043e\u043c\3\2\2\2\u043e\u043f\3\2\2\2\u043f"+ + "\u0441\3\2\2\2\u0440\u043e\3\2\2\2\u0441\u0443\5\u0109\u0085\2\u0442\u043e"+ + "\3\2\2\2\u0442\u0443\3\2\2\2\u0443\u0108\3\2\2\2\u0444\u0445\t\5\2\2\u0445"+ + "\u010a\3\2\2\2\u0446\u044e\t\27\2\2\u0447\u0449\t\30\2\2\u0448\u0447\3"+ + "\2\2\2\u0449\u044c\3\2\2\2\u044a\u0448\3\2\2\2\u044a\u044b\3\2\2\2\u044b"+ + "\u044d\3\2\2\2\u044c\u044a\3\2\2\2\u044d\u044f\t\27\2\2\u044e\u044a\3"+ + "\2\2\2\u044e\u044f\3\2\2\2\u044f\u010c\3\2\2\2\u0450\u0453\5\u010f\u0088"+ + "\2\u0451\u0453\t\27\2\2\u0452\u0450\3\2\2\2\u0452\u0451\3\2\2\2\u0453"+ + "\u010e\3\2\2\2\u0454\u0459\t\31\2\2\u0455\u0459\n\32\2\2\u0456\u0457\t"+ + "\33\2\2\u0457\u0459\t\34\2\2\u0458\u0454\3\2\2\2\u0458\u0455\3\2\2\2\u0458"+ + "\u0456\3\2\2\2\u0459\u0110\3\2\2\2\65\2\u02d6\u02db\u02de\u02e0\u02e3"+ + "\u02eb\u02ef\u02f2\u02f8\u02ff\u0303\u0306\u030e\u0312\u0315\u031a\u031e"+ + "\u0321\u0324\u0329\u032c\u032e\u0334\u0337\u033b\u033f\u0343\u034e\u0353"+ + "\u035a\u035c\u0368\u036e\u0370\u03f8\u0402\u0410\u0419\u041e\u0426\u0429"+ + "\u0430\u0437\u043c\u043e\u0442\u044a\u044e\u0452\u0458\3\2\3\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.tokens b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.tokens new file mode 100644 index 00000000..f811013a --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.tokens @@ -0,0 +1,242 @@ +ABSTRACT=1 +ASSERT=2 +BOOLEAN=3 +BREAK=4 +BYTE=5 +CASE=6 +CATCH=7 +CHAR=8 +CLASS=9 +CONST=10 +CONTINUE=11 +DEFAULT=12 +DO=13 +DOUBLE=14 +ELSE=15 +ENUM=16 +EXTENDS=17 +FINAL=18 +FINALLY=19 +FLOAT=20 +FOR=21 +IF=22 +GOTO=23 +IMPLEMENTS=24 +IMPORT=25 +INSTANCEOF=26 +INT=27 +INTERFACE=28 +LONG=29 +NATIVE=30 +NEW=31 +PACKAGE=32 +PRIVATE=33 +PROTECTED=34 +PUBLIC=35 +RETURN=36 +SHORT=37 +STATIC=38 +STRICTFP=39 +SUPER=40 +SWITCH=41 +SYNCHRONIZED=42 +THIS=43 +THROW=44 +THROWS=45 +TRANSIENT=46 +TRY=47 +VOID=48 +VOLATILE=49 +WHILE=50 +MODULE=51 +OPEN=52 +REQUIRES=53 +EXPORTS=54 +OPENS=55 +TO=56 +USES=57 +PROVIDES=58 +WITH=59 +TRANSITIVE=60 +VAR=61 +YIELD=62 +RECORD=63 +SEALED=64 +PERMITS=65 +NON_SEALED=66 +DECIMAL_LITERAL=67 +HEX_LITERAL=68 +OCT_LITERAL=69 +BINARY_LITERAL=70 +FLOAT_LITERAL=71 +HEX_FLOAT_LITERAL=72 +BOOL_LITERAL=73 +CHAR_LITERAL=74 +STRING_LITERAL=75 +TEXT_BLOCK=76 +NULL_LITERAL=77 +LPAREN=78 +RPAREN=79 +LBRACE=80 +RBRACE=81 +LBRACK=82 +RBRACK=83 +SEMI=84 +COMMA=85 +DOT=86 +ASSIGN=87 +GT=88 +LT=89 +BANG=90 +TILDE=91 +QUESTION=92 +COLON=93 +EQUAL=94 +LE=95 +GE=96 +NOTEQUAL=97 +AND=98 +OR=99 +INC=100 +DEC=101 +ADD=102 +SUB=103 +MUL=104 +DIV=105 +BITAND=106 +BITOR=107 +CARET=108 +MOD=109 +ADD_ASSIGN=110 +SUB_ASSIGN=111 +MUL_ASSIGN=112 +DIV_ASSIGN=113 +AND_ASSIGN=114 +OR_ASSIGN=115 +XOR_ASSIGN=116 +MOD_ASSIGN=117 +LSHIFT_ASSIGN=118 +RSHIFT_ASSIGN=119 +URSHIFT_ASSIGN=120 +ARROW=121 +COLONCOLON=122 +AT=123 +ELLIPSIS=124 +WS=125 +COMMENT=126 +LINE_COMMENT=127 +IDENTIFIER=128 +'abstract'=1 +'assert'=2 +'boolean'=3 +'break'=4 +'byte'=5 +'case'=6 +'catch'=7 +'char'=8 +'class'=9 +'const'=10 +'continue'=11 +'default'=12 +'do'=13 +'double'=14 +'else'=15 +'enum'=16 +'extends'=17 +'final'=18 +'finally'=19 +'float'=20 +'for'=21 +'if'=22 +'goto'=23 +'implements'=24 +'import'=25 +'instanceof'=26 +'int'=27 +'interface'=28 +'long'=29 +'native'=30 +'new'=31 +'package'=32 +'private'=33 +'protected'=34 +'public'=35 +'return'=36 +'short'=37 +'static'=38 +'strictfp'=39 +'super'=40 +'switch'=41 +'synchronized'=42 +'this'=43 +'throw'=44 +'throws'=45 +'transient'=46 +'try'=47 +'void'=48 +'volatile'=49 +'while'=50 +'module'=51 +'open'=52 +'requires'=53 +'exports'=54 +'opens'=55 +'to'=56 +'uses'=57 +'provides'=58 +'with'=59 +'transitive'=60 +'var'=61 +'yield'=62 +'record'=63 +'sealed'=64 +'permits'=65 +'non-sealed'=66 +'null'=77 +'('=78 +')'=79 +'{'=80 +'}'=81 +'['=82 +']'=83 +';'=84 +','=85 +'.'=86 +'='=87 +'>'=88 +'<'=89 +'!'=90 +'~'=91 +'?'=92 +':'=93 +'=='=94 +'<='=95 +'>='=96 +'!='=97 +'&&'=98 +'||'=99 +'++'=100 +'--'=101 +'+'=102 +'-'=103 +'*'=104 +'/'=105 +'&'=106 +'|'=107 +'^'=108 +'%'=109 +'+='=110 +'-='=111 +'*='=112 +'/='=113 +'&='=114 +'|='=115 +'^='=116 +'%='=117 +'<<='=118 +'>>='=119 +'>>>='=120 +'->'=121 +'::'=122 +'@'=123 +'...'=124 diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 new file mode 100644 index 00000000..79457d6d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 @@ -0,0 +1,815 @@ +/* + [The "BSD licence"] + Copyright (c) 2013 Terence Parr, Sam Harwell + Copyright (c) 2017 Ivan Kochurkin (upgrade to Java 8) + Copyright (c) 2021 Michał Lorek (upgrade to Java 11) + Copyright (c) 2022 Michał Lorek (upgrade to Java 17) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +parser grammar JavaParser; + +options { tokenVocab=JavaLexer; } + +expression + : primary + | expression bop='.' + ( + identifier + | methodCall + | THIS + //| NEW nonWildcardTypeArguments? innerCreator + //| SUPER superSuffix + //| explicitGenericInvocation + ) + | expression '[' expression ']' + | methodCall + //| NEW creator + //| '(' annotation* typeType ('&' typeType)* ')' expression + | expression postfix=('++' | '--') + | prefix=('+'|'-'|'++'|'--') expression + | prefix=('~'|'!') expression + | expression bop=('*'|'/'|'%') expression + | expression bop=('+'|'-') expression + | expression ('<' '<' | '>' '>' '>' | '>' '>') expression + | expression bop=('<=' | '>=' | '>' | '<') expression + //| expression bop=INSTANCEOF (typeType | pattern) + | expression bop=('==' | '!=') expression + | expression bop='&' expression + | expression bop='^' expression + | expression bop='|' expression + | expression bop='&&' expression + | expression bop='||' expression + | expression bop='?' expression ':' expression + | expression + bop=('=' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '>>=' | '>>>=' | '<<=' | '%=') + expression + //| lambdaExpression // Java8 + //| switchExpression // Java17 + + // Java 8 methodReference + //| expression '::' typeArguments? identifier + //| typeType '::' (typeArguments? identifier | NEW) + //| classType '::' typeArguments? NEW + ; + +primary + : '(' expression ')' + | THIS + | SUPER + | literal + | identifier + //| typeTypeOrVoid '.' CLASS + //| nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments) + ; + + methodCall + : identifier '(' expressionList? ')' + | THIS '(' expressionList? ')' + | SUPER '(' expressionList? ')' + ; + + + identifier + : IDENTIFIER + | MODULE + | OPEN + | REQUIRES + | EXPORTS + | OPENS + | TO + | USES + | PROVIDES + | WITH + | TRANSITIVE + | YIELD + | SEALED + | PERMITS + | RECORD + | VAR + ; + + literal + : integerLiteral + | floatLiteral + | CHAR_LITERAL + | STRING_LITERAL + | BOOL_LITERAL + | NULL_LITERAL + | TEXT_BLOCK // Java17 + ; + + integerLiteral + : DECIMAL_LITERAL + | HEX_LITERAL + | OCT_LITERAL + | BINARY_LITERAL + ; + + floatLiteral + : FLOAT_LITERAL + | HEX_FLOAT_LITERAL + ; + +/* +parExpression + : '(' expression ')' + ; +*/ + + expressionList + : expression (',' expression)* + ; + + +/*compilationUnit + : packageDeclaration? importDeclaration* typeDeclaration* + | moduleDeclaration EOF + ;*/ + +/* +packageDeclaration + : annotation* PACKAGE qualifiedName ';' + ; +*/ + +/* +importDeclaration + : IMPORT STATIC? qualifiedName ('.' '*')? ';' + ; +*/ + +/* +typeDeclaration + : classOrInterfaceModifier* + (classDeclaration | enumDeclaration | interfaceDeclaration | annotationTypeDeclaration | recordDeclaration) + | ';' + ; +*/ + +/* +modifier + : classOrInterfaceModifier + | NATIVE + | SYNCHRONIZED + | TRANSIENT + | VOLATILE + ; +*/ + +/* +classOrInterfaceModifier + : annotation + | PUBLIC + | PROTECTED + | PRIVATE + | STATIC + | ABSTRACT + | FINAL // FINAL for class only -- does not apply to interfaces + | STRICTFP + | SEALED // Java17 + | NON_SEALED // Java17 + ; +*/ + +/* +variableModifier + : FINAL + | annotation + ; + +classDeclaration + : CLASS identifier typeParameters? + (EXTENDS typeType)? + (IMPLEMENTS typeList)? + (PERMITS typeList)? // Java17 + classBody + ; + +typeParameters + : '<' typeParameter (',' typeParameter)* '>' + ; + +typeParameter + : annotation* identifier (EXTENDS annotation* typeBound)? + ; + +typeBound + : typeType ('&' typeType)* + ; + +enumDeclaration + : ENUM identifier (IMPLEMENTS typeList)? '{' enumConstants? ','? enumBodyDeclarations? '}' + ; + +enumConstants + : enumConstant (',' enumConstant)* + ; + +enumConstant + : annotation* identifier arguments? classBody? + ; + +enumBodyDeclarations + : ';' classBodyDeclaration* + ; + +interfaceDeclaration + : INTERFACE identifier typeParameters? (EXTENDS typeList)? (PERMITS typeList)? interfaceBody + ; + +classBody + : '{' classBodyDeclaration* '}' + ; + +interfaceBody + : '{' interfaceBodyDeclaration* '}' + ; + +*/ +/*classBodyDeclaration + : ';' + | STATIC? block + | modifier* memberDeclaration + ;*//* + + +memberDeclaration + : methodDeclaration + | genericMethodDeclaration + | fieldDeclaration + | constructorDeclaration + | genericConstructorDeclaration + | interfaceDeclaration + | annotationTypeDeclaration + | classDeclaration + | enumDeclaration + | recordDeclaration //Java17 + ; + +*/ +/* We use rule this even for void methods which cannot have [] after parameters. + This simplifies grammar and we can consider void to be a type, which + renders the [] matching as a context-sensitive issue or a semantic check + for invalid return type after parsing. + *//* + +methodDeclaration + : typeTypeOrVoid identifier formalParameters ('[' ']')* + (THROWS qualifiedNameList)? + methodBody + ; + +methodBody + : block + | ';' + ; + +typeTypeOrVoid + : typeType + | VOID + ; + +genericMethodDeclaration + : typeParameters methodDeclaration + ; + +genericConstructorDeclaration + : typeParameters constructorDeclaration + ; + +constructorDeclaration + : identifier formalParameters (THROWS qualifiedNameList)? constructorBody=block + ; + +fieldDeclaration + : typeType variableDeclarators ';' + ; + +interfaceBodyDeclaration + : modifier* interfaceMemberDeclaration + | ';' + ; + +interfaceMemberDeclaration + : constDeclaration + | interfaceMethodDeclaration + | genericInterfaceMethodDeclaration + | interfaceDeclaration + | annotationTypeDeclaration + | classDeclaration + | enumDeclaration + | recordDeclaration // Java17 + ; + +constDeclaration + : typeType constantDeclarator (',' constantDeclarator)* ';' + ; + +constantDeclarator + : identifier ('[' ']')* '=' variableInitializer + ; + +// Early versions of Java allows brackets after the method name, eg. +// public int[] return2DArray() [] { ... } +// is the same as +// public int[][] return2DArray() { ... } +interfaceMethodDeclaration + : interfaceMethodModifier* interfaceCommonBodyDeclaration + ; + +// Java8 +interfaceMethodModifier + : annotation + | PUBLIC + | ABSTRACT + | DEFAULT + | STATIC + | STRICTFP + ; + +genericInterfaceMethodDeclaration + : interfaceMethodModifier* typeParameters interfaceCommonBodyDeclaration + ; + +interfaceCommonBodyDeclaration + : annotation* typeTypeOrVoid identifier formalParameters ('[' ']')* (THROWS qualifiedNameList)? methodBody + ; + +variableDeclarators + : variableDeclarator (',' variableDeclarator)* + ; + +variableDeclarator + : variableDeclaratorId ('=' variableInitializer)? + ; + +variableDeclaratorId + : identifier ('[' ']')* + ; + +variableInitializer + : arrayInitializer + | expression + ; + +arrayInitializer + : '{' (variableInitializer (',' variableInitializer)* (',')? )? '}' + ; + +classOrInterfaceType + : identifier typeArguments? ('.' identifier typeArguments?)* + ; + +typeArgument + : typeType + | annotation* '?' ((EXTENDS | SUPER) typeType)? + ; + +qualifiedNameList + : qualifiedName (',' qualifiedName)* + ; + +formalParameters + : '(' ( receiverParameter? + | receiverParameter (',' formalParameterList)? + | formalParameterList? + ) ')' + ; + +receiverParameter + : typeType (identifier '.')* THIS + ; + +formalParameterList + : formalParameter (',' formalParameter)* (',' lastFormalParameter)? + | lastFormalParameter + ; + +formalParameter + : variableModifier* typeType variableDeclaratorId + ; + +lastFormalParameter + : variableModifier* typeType annotation* '...' variableDeclaratorId + ; + +// local variable type inference +lambdaLVTIList + : lambdaLVTIParameter (',' lambdaLVTIParameter)* + ; + +lambdaLVTIParameter + : variableModifier* VAR identifier + ; + +qualifiedName + : identifier ('.' identifier)* + ; + +literal + : integerLiteral + | floatLiteral + | CHAR_LITERAL + | STRING_LITERAL + | BOOL_LITERAL + | NULL_LITERAL + | TEXT_BLOCK // Java17 + ; + +integerLiteral + : DECIMAL_LITERAL + | HEX_LITERAL + | OCT_LITERAL + | BINARY_LITERAL + ; + +floatLiteral + : FLOAT_LITERAL + | HEX_FLOAT_LITERAL + ; + +// ANNOTATIONS +altAnnotationQualifiedName + : (identifier DOT)* '@' identifier + ; + +annotation + : ('@' qualifiedName | altAnnotationQualifiedName) ('(' ( elementValuePairs | elementValue )? ')')? + ; + +elementValuePairs + : elementValuePair (',' elementValuePair)* + ; + +elementValuePair + : identifier '=' elementValue + ; + +elementValue + : expression + | annotation + | elementValueArrayInitializer + ; + +elementValueArrayInitializer + : '{' (elementValue (',' elementValue)*)? (',')? '}' + ; + +annotationTypeDeclaration + : '@' INTERFACE identifier annotationTypeBody + ; + +annotationTypeBody + : '{' (annotationTypeElementDeclaration)* '}' + ; +*/ + +/* +annotationTypeElementDeclaration + : modifier* annotationTypeElementRest + | ';' // this is not allowed by the grammar, but apparently allowed by the actual compiler + ; +*/ + +/*annotationTypeElementRest + : typeType annotationMethodOrConstantRest ';' + | classDeclaration ';'? + | interfaceDeclaration ';'? + | enumDeclaration ';'? + | annotationTypeDeclaration ';'? + | recordDeclaration ';'? // Java17 + ; + +annotationMethodOrConstantRest + : annotationMethodRest + | annotationConstantRest + ; + +annotationMethodRest + : identifier '(' ')' defaultValue? + ; + +annotationConstantRest + : variableDeclarators + ; + +defaultValue + : DEFAULT elementValue + ;*/ + +// MODULES - Java9 + +/*moduleDeclaration + : OPEN? MODULE qualifiedName moduleBody + ; + +moduleBody + : '{' moduleDirective* '}' + ; + +moduleDirective + : REQUIRES requiresModifier* qualifiedName ';' + | EXPORTS qualifiedName (TO qualifiedName)? ';' + | OPENS qualifiedName (TO qualifiedName)? ';' + | USES qualifiedName ';' + | PROVIDES qualifiedName WITH qualifiedName ';' + ; + +requiresModifier + : TRANSITIVE + | STATIC + ; + +// RECORDS - Java 17 + +recordDeclaration + : RECORD identifier typeParameters? recordHeader + (IMPLEMENTS typeList)? + recordBody + ; + +recordHeader + : '(' recordComponentList? ')' + ; + +recordComponentList + : recordComponent (',' recordComponent)* + ; + +recordComponent + : typeType identifier + ; + +recordBody + : '{' classBodyDeclaration* '}' + ;*/ + +// STATEMENTS / BLOCKS + +/*block + : '{' blockStatement* '}' + ; + +blockStatement + : localVariableDeclaration ';' + | statement + | localTypeDeclaration + ; + +localVariableDeclaration + : variableModifier* (typeType variableDeclarators | VAR identifier '=' expression) + ; + +identifier + : IDENTIFIER + | MODULE + | OPEN + | REQUIRES + | EXPORTS + | OPENS + | TO + | USES + | PROVIDES + | WITH + | TRANSITIVE + | YIELD + | SEALED + | PERMITS + | RECORD + | VAR + ; + +localTypeDeclaration + : classOrInterfaceModifier* + (classDeclaration | interfaceDeclaration | recordDeclaration) + | ';' + ; + +statement + : blockLabel=block + | ASSERT expression (':' expression)? ';' + | IF parExpression statement (ELSE statement)? + | FOR '(' forControl ')' statement + | WHILE parExpression statement + | DO statement WHILE parExpression ';' + | TRY block (catchClause+ finallyBlock? | finallyBlock) + | TRY resourceSpecification block catchClause* finallyBlock? + | SWITCH parExpression '{' switchBlockStatementGroup* switchLabel* '}' + | SYNCHRONIZED parExpression block + | RETURN expression? ';' + | THROW expression ';' + | BREAK identifier? ';' + | CONTINUE identifier? ';' + | YIELD expression ';' // Java17 + | SEMI + | statementExpression=expression ';' + | switchExpression ';'? // Java17 + | identifierLabel=identifier ':' statement + ;*/ + +/*catchClause + : CATCH '(' variableModifier* catchType identifier ')' block + ; + +catchType + : qualifiedName ('|' qualifiedName)* + ; + +finallyBlock + : FINALLY block + ; + +resourceSpecification + : '(' resources ';'? ')' + ; + +resources + : resource (';' resource)* + ; + +resource + : variableModifier* ( classOrInterfaceType variableDeclaratorId | VAR identifier ) '=' expression + | identifier + ;*/ + +/** Matches cases then statements, both of which are mandatory. + * To handle empty cases at the end, we add switchLabel* to statement. + */ +/*switchBlockStatementGroup + : switchLabel+ blockStatement+ + ; + +switchLabel + : CASE (constantExpression=expression | enumConstantName=IDENTIFIER | typeType varName=identifier) ':' + | DEFAULT ':' + ; + +forControl + : enhancedForControl + | forInit? ';' expression? ';' forUpdate=expressionList? + ; + +forInit + : localVariableDeclaration + | expressionList + ; + +enhancedForControl + : variableModifier* (typeType | VAR) variableDeclaratorId ':' expression + ;*/ + +// EXPRESSIONS +/* +// Java17 +pattern + : variableModifier* typeType annotation* identifier + ; + +// Java8 +lambdaExpression + : lambdaParameters '->' lambdaBody + ; + +// Java8 +lambdaParameters + : identifier + | '(' formalParameterList? ')' + | '(' identifier (',' identifier)* ')' + | '(' lambdaLVTIList? ')' + ; + +// Java8 +lambdaBody + : expression + | block + ; + +// Java17 +switchExpression + : SWITCH parExpression '{' switchLabeledRule* '}' + ; +*/ + +/*// Java17 +switchLabeledRule + : CASE (expressionList | NULL_LITERAL | guardedPattern) (ARROW | COLON) switchRuleOutcome + | DEFAULT (ARROW | COLON) switchRuleOutcome + ; + +// Java17 +guardedPattern + : '(' guardedPattern ')' + | variableModifier* typeType annotation* identifier ('&&' expression)* + | guardedPattern '&&' expression + ;*/ + +// Java17 +/* +switchRuleOutcome + : block + | blockStatement* + ; + +classType + : (classOrInterfaceType '.')? annotation* identifier typeArguments? + ; + +creator + : nonWildcardTypeArguments createdName classCreatorRest + | createdName (arrayCreatorRest | classCreatorRest) + ; + +createdName + : identifier typeArgumentsOrDiamond? ('.' identifier typeArgumentsOrDiamond?)* + | primitiveType + ; + +innerCreator + : identifier nonWildcardTypeArgumentsOrDiamond? classCreatorRest + ; + +arrayCreatorRest + : '[' (']' ('[' ']')* arrayInitializer | expression ']' ('[' expression ']')* ('[' ']')*) + ; + +classCreatorRest + : arguments classBody? + ; + +explicitGenericInvocation + : nonWildcardTypeArguments explicitGenericInvocationSuffix + ; + +typeArgumentsOrDiamond + : '<' '>' + | typeArguments + ; + +nonWildcardTypeArgumentsOrDiamond + : '<' '>' + | nonWildcardTypeArguments + ; + +nonWildcardTypeArguments + : '<' typeList '>' + ; + +typeList + : typeType (',' typeType)* + ; + +typeType + : annotation* (classOrInterfaceType | primitiveType) (annotation* '[' ']')* + ; + +primitiveType + : BOOLEAN + | CHAR + | BYTE + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + ; + +typeArguments + : '<' typeArgument (',' typeArgument)* '>' + ; + +superSuffix + : arguments + | '.' typeArguments? identifier arguments? + ; + +explicitGenericInvocationSuffix + : SUPER superSuffix + | identifier arguments + ; + +arguments + : '(' expressionList? ')' + ;*/ diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.interp b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.interp new file mode 100644 index 00000000..522aeebf --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.interp @@ -0,0 +1,275 @@ +token literal names: +null +'abstract' +'assert' +'boolean' +'break' +'byte' +'case' +'catch' +'char' +'class' +'const' +'continue' +'default' +'do' +'double' +'else' +'enum' +'extends' +'final' +'finally' +'float' +'for' +'if' +'goto' +'implements' +'import' +'instanceof' +'int' +'interface' +'long' +'native' +'new' +'package' +'private' +'protected' +'public' +'return' +'short' +'static' +'strictfp' +'super' +'switch' +'synchronized' +'this' +'throw' +'throws' +'transient' +'try' +'void' +'volatile' +'while' +'module' +'open' +'requires' +'exports' +'opens' +'to' +'uses' +'provides' +'with' +'transitive' +'var' +'yield' +'record' +'sealed' +'permits' +'non-sealed' +null +null +null +null +null +null +null +null +null +null +'null' +'(' +')' +'{' +'}' +'[' +']' +';' +',' +'.' +'=' +'>' +'<' +'!' +'~' +'?' +':' +'==' +'<=' +'>=' +'!=' +'&&' +'||' +'++' +'--' +'+' +'-' +'*' +'/' +'&' +'|' +'^' +'%' +'+=' +'-=' +'*=' +'/=' +'&=' +'|=' +'^=' +'%=' +'<<=' +'>>=' +'>>>=' +'->' +'::' +'@' +'...' +null +null +null +null + +token symbolic names: +null +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER + +rule names: +expression +primary +methodCall +identifier +literal +integerLiteral +floatLiteral +expressionList + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 130, 148, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 42, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 80, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 89, 10, 2, 12, 2, 14, 2, 92, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 102, 10, 3, 3, 4, 3, 4, 3, 4, 5, 4, 107, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 114, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 120, 10, 4, 3, 4, 5, 4, 123, 10, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 134, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 143, 10, 9, 12, 9, 14, 9, 146, 11, 9, 3, 9, 2, 3, 2, 10, 2, 4, 6, 8, 10, 12, 14, 16, 2, 13, 3, 2, 102, 105, 3, 2, 92, 93, 4, 2, 106, 107, 111, 111, 3, 2, 104, 105, 4, 2, 90, 91, 97, 98, 4, 2, 96, 96, 99, 99, 4, 2, 89, 89, 112, 122, 3, 2, 102, 103, 4, 2, 53, 67, 130, 130, 3, 2, 69, 72, 3, 2, 73, 74, 2, 177, 2, 25, 3, 2, 2, 2, 4, 101, 3, 2, 2, 2, 6, 122, 3, 2, 2, 2, 8, 124, 3, 2, 2, 2, 10, 133, 3, 2, 2, 2, 12, 135, 3, 2, 2, 2, 14, 137, 3, 2, 2, 2, 16, 139, 3, 2, 2, 2, 18, 19, 8, 2, 1, 2, 19, 26, 5, 4, 3, 2, 20, 26, 5, 6, 4, 2, 21, 22, 9, 2, 2, 2, 22, 26, 5, 2, 2, 16, 23, 24, 9, 3, 2, 2, 24, 26, 5, 2, 2, 15, 25, 18, 3, 2, 2, 2, 25, 20, 3, 2, 2, 2, 25, 21, 3, 2, 2, 2, 25, 23, 3, 2, 2, 2, 26, 90, 3, 2, 2, 2, 27, 28, 12, 14, 2, 2, 28, 29, 9, 4, 2, 2, 29, 89, 5, 2, 2, 15, 30, 31, 12, 13, 2, 2, 31, 32, 9, 5, 2, 2, 32, 89, 5, 2, 2, 14, 33, 41, 12, 12, 2, 2, 34, 35, 7, 91, 2, 2, 35, 42, 7, 91, 2, 2, 36, 37, 7, 90, 2, 2, 37, 38, 7, 90, 2, 2, 38, 42, 7, 90, 2, 2, 39, 40, 7, 90, 2, 2, 40, 42, 7, 90, 2, 2, 41, 34, 3, 2, 2, 2, 41, 36, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 89, 5, 2, 2, 13, 44, 45, 12, 11, 2, 2, 45, 46, 9, 6, 2, 2, 46, 89, 5, 2, 2, 12, 47, 48, 12, 10, 2, 2, 48, 49, 9, 7, 2, 2, 49, 89, 5, 2, 2, 11, 50, 51, 12, 9, 2, 2, 51, 52, 7, 108, 2, 2, 52, 89, 5, 2, 2, 10, 53, 54, 12, 8, 2, 2, 54, 55, 7, 110, 2, 2, 55, 89, 5, 2, 2, 9, 56, 57, 12, 7, 2, 2, 57, 58, 7, 109, 2, 2, 58, 89, 5, 2, 2, 8, 59, 60, 12, 6, 2, 2, 60, 61, 7, 100, 2, 2, 61, 89, 5, 2, 2, 7, 62, 63, 12, 5, 2, 2, 63, 64, 7, 101, 2, 2, 64, 89, 5, 2, 2, 6, 65, 66, 12, 4, 2, 2, 66, 67, 7, 94, 2, 2, 67, 68, 5, 2, 2, 2, 68, 69, 7, 95, 2, 2, 69, 70, 5, 2, 2, 4, 70, 89, 3, 2, 2, 2, 71, 72, 12, 3, 2, 2, 72, 73, 9, 8, 2, 2, 73, 89, 5, 2, 2, 3, 74, 75, 12, 20, 2, 2, 75, 79, 7, 88, 2, 2, 76, 80, 5, 8, 5, 2, 77, 80, 5, 6, 4, 2, 78, 80, 7, 45, 2, 2, 79, 76, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 78, 3, 2, 2, 2, 80, 89, 3, 2, 2, 2, 81, 82, 12, 19, 2, 2, 82, 83, 7, 84, 2, 2, 83, 84, 5, 2, 2, 2, 84, 85, 7, 85, 2, 2, 85, 89, 3, 2, 2, 2, 86, 87, 12, 17, 2, 2, 87, 89, 9, 9, 2, 2, 88, 27, 3, 2, 2, 2, 88, 30, 3, 2, 2, 2, 88, 33, 3, 2, 2, 2, 88, 44, 3, 2, 2, 2, 88, 47, 3, 2, 2, 2, 88, 50, 3, 2, 2, 2, 88, 53, 3, 2, 2, 2, 88, 56, 3, 2, 2, 2, 88, 59, 3, 2, 2, 2, 88, 62, 3, 2, 2, 2, 88, 65, 3, 2, 2, 2, 88, 71, 3, 2, 2, 2, 88, 74, 3, 2, 2, 2, 88, 81, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 3, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 94, 7, 80, 2, 2, 94, 95, 5, 2, 2, 2, 95, 96, 7, 81, 2, 2, 96, 102, 3, 2, 2, 2, 97, 102, 7, 45, 2, 2, 98, 102, 7, 42, 2, 2, 99, 102, 5, 10, 6, 2, 100, 102, 5, 8, 5, 2, 101, 93, 3, 2, 2, 2, 101, 97, 3, 2, 2, 2, 101, 98, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 5, 3, 2, 2, 2, 103, 104, 5, 8, 5, 2, 104, 106, 7, 80, 2, 2, 105, 107, 5, 16, 9, 2, 106, 105, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 7, 81, 2, 2, 109, 123, 3, 2, 2, 2, 110, 111, 7, 45, 2, 2, 111, 113, 7, 80, 2, 2, 112, 114, 5, 16, 9, 2, 113, 112, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 123, 7, 81, 2, 2, 116, 117, 7, 42, 2, 2, 117, 119, 7, 80, 2, 2, 118, 120, 5, 16, 9, 2, 119, 118, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 123, 7, 81, 2, 2, 122, 103, 3, 2, 2, 2, 122, 110, 3, 2, 2, 2, 122, 116, 3, 2, 2, 2, 123, 7, 3, 2, 2, 2, 124, 125, 9, 10, 2, 2, 125, 9, 3, 2, 2, 2, 126, 134, 5, 12, 7, 2, 127, 134, 5, 14, 8, 2, 128, 134, 7, 76, 2, 2, 129, 134, 7, 77, 2, 2, 130, 134, 7, 75, 2, 2, 131, 134, 7, 79, 2, 2, 132, 134, 7, 78, 2, 2, 133, 126, 3, 2, 2, 2, 133, 127, 3, 2, 2, 2, 133, 128, 3, 2, 2, 2, 133, 129, 3, 2, 2, 2, 133, 130, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 132, 3, 2, 2, 2, 134, 11, 3, 2, 2, 2, 135, 136, 9, 11, 2, 2, 136, 13, 3, 2, 2, 2, 137, 138, 9, 12, 2, 2, 138, 15, 3, 2, 2, 2, 139, 144, 5, 2, 2, 2, 140, 141, 7, 87, 2, 2, 141, 143, 5, 2, 2, 2, 142, 140, 3, 2, 2, 2, 143, 146, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 17, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 14, 25, 41, 79, 88, 90, 101, 106, 113, 119, 122, 133, 144] \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.java new file mode 100644 index 00000000..d7e760bd --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.java @@ -0,0 +1,1304 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class JavaParser extends Parser { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, + CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, + ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, + IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, + NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, + SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, + THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, + WHILE=50, MODULE=51, OPEN=52, REQUIRES=53, EXPORTS=54, OPENS=55, TO=56, + USES=57, PROVIDES=58, WITH=59, TRANSITIVE=60, VAR=61, YIELD=62, RECORD=63, + SEALED=64, PERMITS=65, NON_SEALED=66, DECIMAL_LITERAL=67, HEX_LITERAL=68, + OCT_LITERAL=69, BINARY_LITERAL=70, FLOAT_LITERAL=71, HEX_FLOAT_LITERAL=72, + BOOL_LITERAL=73, CHAR_LITERAL=74, STRING_LITERAL=75, TEXT_BLOCK=76, NULL_LITERAL=77, + LPAREN=78, RPAREN=79, LBRACE=80, RBRACE=81, LBRACK=82, RBRACK=83, SEMI=84, + COMMA=85, DOT=86, ASSIGN=87, GT=88, LT=89, BANG=90, TILDE=91, QUESTION=92, + COLON=93, EQUAL=94, LE=95, GE=96, NOTEQUAL=97, AND=98, OR=99, INC=100, + DEC=101, ADD=102, SUB=103, MUL=104, DIV=105, BITAND=106, BITOR=107, CARET=108, + MOD=109, ADD_ASSIGN=110, SUB_ASSIGN=111, MUL_ASSIGN=112, DIV_ASSIGN=113, + AND_ASSIGN=114, OR_ASSIGN=115, XOR_ASSIGN=116, MOD_ASSIGN=117, LSHIFT_ASSIGN=118, + RSHIFT_ASSIGN=119, URSHIFT_ASSIGN=120, ARROW=121, COLONCOLON=122, AT=123, + ELLIPSIS=124, WS=125, COMMENT=126, LINE_COMMENT=127, IDENTIFIER=128; + public static final int + RULE_expression = 0, RULE_primary = 1, RULE_methodCall = 2, RULE_identifier = 3, + RULE_literal = 4, RULE_integerLiteral = 5, RULE_floatLiteral = 6, RULE_expressionList = 7; + private static String[] makeRuleNames() { + return new String[] { + "expression", "primary", "methodCall", "identifier", "literal", "integerLiteral", + "floatLiteral", "expressionList" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'", "'case'", + "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'", + "'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", + "'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", + "'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'", + "'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'", + "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", + "'transient'", "'try'", "'void'", "'volatile'", "'while'", "'module'", + "'open'", "'requires'", "'exports'", "'opens'", "'to'", "'uses'", "'provides'", + "'with'", "'transitive'", "'var'", "'yield'", "'record'", "'sealed'", + "'permits'", "'non-sealed'", null, null, null, null, null, null, null, + null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'", + "';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", + "'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", + "'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", + "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'->'", + "'::'", "'@'", "'...'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", + "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", + "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", + "IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", + "NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", + "STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", + "THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", + "OPEN", "REQUIRES", "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", + "TRANSITIVE", "VAR", "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", + "DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", + "HEX_FLOAT_LITERAL", "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", + "TEXT_BLOCK", "NULL_LITERAL", "LPAREN", "RPAREN", "LBRACE", "RBRACE", + "LBRACK", "RBRACK", "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", + "TILDE", "QUESTION", "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", + "OR", "INC", "DEC", "ADD", "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", + "MOD", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", + "OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", + "URSHIFT_ASSIGN", "ARROW", "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", + "LINE_COMMENT", "IDENTIFIER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "JavaParser.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public JavaParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + public static class ExpressionContext extends ParserRuleContext { + public Token prefix; + public Token bop; + public Token postfix; + public PrimaryContext primary() { + return getRuleContext(PrimaryContext.class,0); + } + public MethodCallContext methodCall() { + return getRuleContext(MethodCallContext.class,0); + } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode ADD() { return getToken(JavaParser.ADD, 0); } + public TerminalNode SUB() { return getToken(JavaParser.SUB, 0); } + public TerminalNode INC() { return getToken(JavaParser.INC, 0); } + public TerminalNode DEC() { return getToken(JavaParser.DEC, 0); } + public TerminalNode TILDE() { return getToken(JavaParser.TILDE, 0); } + public TerminalNode BANG() { return getToken(JavaParser.BANG, 0); } + public TerminalNode MUL() { return getToken(JavaParser.MUL, 0); } + public TerminalNode DIV() { return getToken(JavaParser.DIV, 0); } + public TerminalNode MOD() { return getToken(JavaParser.MOD, 0); } + public List LT() { return getTokens(JavaParser.LT); } + public TerminalNode LT(int i) { + return getToken(JavaParser.LT, i); + } + public List GT() { return getTokens(JavaParser.GT); } + public TerminalNode GT(int i) { + return getToken(JavaParser.GT, i); + } + public TerminalNode LE() { return getToken(JavaParser.LE, 0); } + public TerminalNode GE() { return getToken(JavaParser.GE, 0); } + public TerminalNode EQUAL() { return getToken(JavaParser.EQUAL, 0); } + public TerminalNode NOTEQUAL() { return getToken(JavaParser.NOTEQUAL, 0); } + public TerminalNode BITAND() { return getToken(JavaParser.BITAND, 0); } + public TerminalNode CARET() { return getToken(JavaParser.CARET, 0); } + public TerminalNode BITOR() { return getToken(JavaParser.BITOR, 0); } + public TerminalNode AND() { return getToken(JavaParser.AND, 0); } + public TerminalNode OR() { return getToken(JavaParser.OR, 0); } + public TerminalNode COLON() { return getToken(JavaParser.COLON, 0); } + public TerminalNode QUESTION() { return getToken(JavaParser.QUESTION, 0); } + public TerminalNode ASSIGN() { return getToken(JavaParser.ASSIGN, 0); } + public TerminalNode ADD_ASSIGN() { return getToken(JavaParser.ADD_ASSIGN, 0); } + public TerminalNode SUB_ASSIGN() { return getToken(JavaParser.SUB_ASSIGN, 0); } + public TerminalNode MUL_ASSIGN() { return getToken(JavaParser.MUL_ASSIGN, 0); } + public TerminalNode DIV_ASSIGN() { return getToken(JavaParser.DIV_ASSIGN, 0); } + public TerminalNode AND_ASSIGN() { return getToken(JavaParser.AND_ASSIGN, 0); } + public TerminalNode OR_ASSIGN() { return getToken(JavaParser.OR_ASSIGN, 0); } + public TerminalNode XOR_ASSIGN() { return getToken(JavaParser.XOR_ASSIGN, 0); } + public TerminalNode RSHIFT_ASSIGN() { return getToken(JavaParser.RSHIFT_ASSIGN, 0); } + public TerminalNode URSHIFT_ASSIGN() { return getToken(JavaParser.URSHIFT_ASSIGN, 0); } + public TerminalNode LSHIFT_ASSIGN() { return getToken(JavaParser.LSHIFT_ASSIGN, 0); } + public TerminalNode MOD_ASSIGN() { return getToken(JavaParser.MOD_ASSIGN, 0); } + public TerminalNode DOT() { return getToken(JavaParser.DOT, 0); } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public TerminalNode THIS() { return getToken(JavaParser.THIS, 0); } + public TerminalNode LBRACK() { return getToken(JavaParser.LBRACK, 0); } + public TerminalNode RBRACK() { return getToken(JavaParser.RBRACK, 0); } + public ExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitExpression(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionContext expression() throws RecognitionException { + return expression(0); + } + + private ExpressionContext expression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); + ExpressionContext _prevctx = _localctx; + int _startState = 0; + enterRecursionRule(_localctx, 0, RULE_expression, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(23); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { + case 1: + { + setState(17); + primary(); + } + break; + case 2: + { + setState(18); + methodCall(); + } + break; + case 3: + { + setState(19); + ((ExpressionContext)_localctx).prefix = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 100)) & ~0x3f) == 0 && ((1L << (_la - 100)) & ((1L << (INC - 100)) | (1L << (DEC - 100)) | (1L << (ADD - 100)) | (1L << (SUB - 100)))) != 0)) ) { + ((ExpressionContext)_localctx).prefix = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(20); + expression(14); + } + break; + case 4: + { + setState(21); + ((ExpressionContext)_localctx).prefix = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==BANG || _la==TILDE) ) { + ((ExpressionContext)_localctx).prefix = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(22); + expression(13); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(88); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,4,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(86); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(25); + if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); + setState(26); + ((ExpressionContext)_localctx).bop = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 104)) & ~0x3f) == 0 && ((1L << (_la - 104)) & ((1L << (MUL - 104)) | (1L << (DIV - 104)) | (1L << (MOD - 104)))) != 0)) ) { + ((ExpressionContext)_localctx).bop = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(27); + expression(13); + } + break; + case 2: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(28); + if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); + setState(29); + ((ExpressionContext)_localctx).bop = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==ADD || _la==SUB) ) { + ((ExpressionContext)_localctx).bop = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(30); + expression(12); + } + break; + case 3: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(31); + if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); + setState(39); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { + case 1: + { + setState(32); + match(LT); + setState(33); + match(LT); + } + break; + case 2: + { + setState(34); + match(GT); + setState(35); + match(GT); + setState(36); + match(GT); + } + break; + case 3: + { + setState(37); + match(GT); + setState(38); + match(GT); + } + break; + } + setState(41); + expression(11); + } + break; + case 4: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(42); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); + setState(43); + ((ExpressionContext)_localctx).bop = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 88)) & ~0x3f) == 0 && ((1L << (_la - 88)) & ((1L << (GT - 88)) | (1L << (LT - 88)) | (1L << (LE - 88)) | (1L << (GE - 88)))) != 0)) ) { + ((ExpressionContext)_localctx).bop = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(44); + expression(10); + } + break; + case 5: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(45); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); + setState(46); + ((ExpressionContext)_localctx).bop = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==EQUAL || _la==NOTEQUAL) ) { + ((ExpressionContext)_localctx).bop = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(47); + expression(9); + } + break; + case 6: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(48); + if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); + setState(49); + ((ExpressionContext)_localctx).bop = match(BITAND); + setState(50); + expression(8); + } + break; + case 7: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(51); + if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); + setState(52); + ((ExpressionContext)_localctx).bop = match(CARET); + setState(53); + expression(7); + } + break; + case 8: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(54); + if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); + setState(55); + ((ExpressionContext)_localctx).bop = match(BITOR); + setState(56); + expression(6); + } + break; + case 9: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(57); + if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); + setState(58); + ((ExpressionContext)_localctx).bop = match(AND); + setState(59); + expression(5); + } + break; + case 10: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(60); + if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); + setState(61); + ((ExpressionContext)_localctx).bop = match(OR); + setState(62); + expression(4); + } + break; + case 11: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(63); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(64); + ((ExpressionContext)_localctx).bop = match(QUESTION); + setState(65); + expression(0); + setState(66); + match(COLON); + setState(67); + expression(2); + } + break; + case 12: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(69); + if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); + setState(70); + ((ExpressionContext)_localctx).bop = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 87)) & ~0x3f) == 0 && ((1L << (_la - 87)) & ((1L << (ASSIGN - 87)) | (1L << (ADD_ASSIGN - 87)) | (1L << (SUB_ASSIGN - 87)) | (1L << (MUL_ASSIGN - 87)) | (1L << (DIV_ASSIGN - 87)) | (1L << (AND_ASSIGN - 87)) | (1L << (OR_ASSIGN - 87)) | (1L << (XOR_ASSIGN - 87)) | (1L << (MOD_ASSIGN - 87)) | (1L << (LSHIFT_ASSIGN - 87)) | (1L << (RSHIFT_ASSIGN - 87)) | (1L << (URSHIFT_ASSIGN - 87)))) != 0)) ) { + ((ExpressionContext)_localctx).bop = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(71); + expression(1); + } + break; + case 13: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(72); + if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); + setState(73); + ((ExpressionContext)_localctx).bop = match(DOT); + setState(77); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { + case 1: + { + setState(74); + identifier(); + } + break; + case 2: + { + setState(75); + methodCall(); + } + break; + case 3: + { + setState(76); + match(THIS); + } + break; + } + } + break; + case 14: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(79); + if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); + setState(80); + match(LBRACK); + setState(81); + expression(0); + setState(82); + match(RBRACK); + } + break; + case 15: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(84); + if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); + setState(85); + ((ExpressionContext)_localctx).postfix = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==INC || _la==DEC) ) { + ((ExpressionContext)_localctx).postfix = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + break; + } + } + } + setState(90); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,4,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class PrimaryContext extends ParserRuleContext { + public TerminalNode LPAREN() { return getToken(JavaParser.LPAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode RPAREN() { return getToken(JavaParser.RPAREN, 0); } + public TerminalNode THIS() { return getToken(JavaParser.THIS, 0); } + public TerminalNode SUPER() { return getToken(JavaParser.SUPER, 0); } + public LiteralContext literal() { + return getRuleContext(LiteralContext.class,0); + } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public PrimaryContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_primary; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterPrimary(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitPrimary(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitPrimary(this); + else return visitor.visitChildren(this); + } + } + + public final PrimaryContext primary() throws RecognitionException { + PrimaryContext _localctx = new PrimaryContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_primary); + try { + setState(99); + _errHandler.sync(this); + switch (_input.LA(1)) { + case LPAREN: + enterOuterAlt(_localctx, 1); + { + setState(91); + match(LPAREN); + setState(92); + expression(0); + setState(93); + match(RPAREN); + } + break; + case THIS: + enterOuterAlt(_localctx, 2); + { + setState(95); + match(THIS); + } + break; + case SUPER: + enterOuterAlt(_localctx, 3); + { + setState(96); + match(SUPER); + } + break; + case DECIMAL_LITERAL: + case HEX_LITERAL: + case OCT_LITERAL: + case BINARY_LITERAL: + case FLOAT_LITERAL: + case HEX_FLOAT_LITERAL: + case BOOL_LITERAL: + case CHAR_LITERAL: + case STRING_LITERAL: + case TEXT_BLOCK: + case NULL_LITERAL: + enterOuterAlt(_localctx, 4); + { + setState(97); + literal(); + } + break; + case MODULE: + case OPEN: + case REQUIRES: + case EXPORTS: + case OPENS: + case TO: + case USES: + case PROVIDES: + case WITH: + case TRANSITIVE: + case VAR: + case YIELD: + case RECORD: + case SEALED: + case PERMITS: + case IDENTIFIER: + enterOuterAlt(_localctx, 5); + { + setState(98); + identifier(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodCallContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public TerminalNode LPAREN() { return getToken(JavaParser.LPAREN, 0); } + public TerminalNode RPAREN() { return getToken(JavaParser.RPAREN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode THIS() { return getToken(JavaParser.THIS, 0); } + public TerminalNode SUPER() { return getToken(JavaParser.SUPER, 0); } + public MethodCallContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodCall; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterMethodCall(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitMethodCall(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitMethodCall(this); + else return visitor.visitChildren(this); + } + } + + public final MethodCallContext methodCall() throws RecognitionException { + MethodCallContext _localctx = new MethodCallContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_methodCall); + int _la; + try { + setState(120); + _errHandler.sync(this); + switch (_input.LA(1)) { + case MODULE: + case OPEN: + case REQUIRES: + case EXPORTS: + case OPENS: + case TO: + case USES: + case PROVIDES: + case WITH: + case TRANSITIVE: + case VAR: + case YIELD: + case RECORD: + case SEALED: + case PERMITS: + case IDENTIFIER: + enterOuterAlt(_localctx, 1); + { + setState(101); + identifier(); + setState(102); + match(LPAREN); + setState(104); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (SUPER - 40)) | (1L << (THIS - 40)) | (1L << (MODULE - 40)) | (1L << (OPEN - 40)) | (1L << (REQUIRES - 40)) | (1L << (EXPORTS - 40)) | (1L << (OPENS - 40)) | (1L << (TO - 40)) | (1L << (USES - 40)) | (1L << (PROVIDES - 40)) | (1L << (WITH - 40)) | (1L << (TRANSITIVE - 40)) | (1L << (VAR - 40)) | (1L << (YIELD - 40)) | (1L << (RECORD - 40)) | (1L << (SEALED - 40)) | (1L << (PERMITS - 40)) | (1L << (DECIMAL_LITERAL - 40)) | (1L << (HEX_LITERAL - 40)) | (1L << (OCT_LITERAL - 40)) | (1L << (BINARY_LITERAL - 40)) | (1L << (FLOAT_LITERAL - 40)) | (1L << (HEX_FLOAT_LITERAL - 40)) | (1L << (BOOL_LITERAL - 40)) | (1L << (CHAR_LITERAL - 40)) | (1L << (STRING_LITERAL - 40)) | (1L << (TEXT_BLOCK - 40)) | (1L << (NULL_LITERAL - 40)) | (1L << (LPAREN - 40)) | (1L << (BANG - 40)) | (1L << (TILDE - 40)) | (1L << (INC - 40)) | (1L << (DEC - 40)) | (1L << (ADD - 40)) | (1L << (SUB - 40)))) != 0) || _la==IDENTIFIER) { + { + setState(103); + expressionList(); + } + } + + setState(106); + match(RPAREN); + } + break; + case THIS: + enterOuterAlt(_localctx, 2); + { + setState(108); + match(THIS); + setState(109); + match(LPAREN); + setState(111); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (SUPER - 40)) | (1L << (THIS - 40)) | (1L << (MODULE - 40)) | (1L << (OPEN - 40)) | (1L << (REQUIRES - 40)) | (1L << (EXPORTS - 40)) | (1L << (OPENS - 40)) | (1L << (TO - 40)) | (1L << (USES - 40)) | (1L << (PROVIDES - 40)) | (1L << (WITH - 40)) | (1L << (TRANSITIVE - 40)) | (1L << (VAR - 40)) | (1L << (YIELD - 40)) | (1L << (RECORD - 40)) | (1L << (SEALED - 40)) | (1L << (PERMITS - 40)) | (1L << (DECIMAL_LITERAL - 40)) | (1L << (HEX_LITERAL - 40)) | (1L << (OCT_LITERAL - 40)) | (1L << (BINARY_LITERAL - 40)) | (1L << (FLOAT_LITERAL - 40)) | (1L << (HEX_FLOAT_LITERAL - 40)) | (1L << (BOOL_LITERAL - 40)) | (1L << (CHAR_LITERAL - 40)) | (1L << (STRING_LITERAL - 40)) | (1L << (TEXT_BLOCK - 40)) | (1L << (NULL_LITERAL - 40)) | (1L << (LPAREN - 40)) | (1L << (BANG - 40)) | (1L << (TILDE - 40)) | (1L << (INC - 40)) | (1L << (DEC - 40)) | (1L << (ADD - 40)) | (1L << (SUB - 40)))) != 0) || _la==IDENTIFIER) { + { + setState(110); + expressionList(); + } + } + + setState(113); + match(RPAREN); + } + break; + case SUPER: + enterOuterAlt(_localctx, 3); + { + setState(114); + match(SUPER); + setState(115); + match(LPAREN); + setState(117); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (SUPER - 40)) | (1L << (THIS - 40)) | (1L << (MODULE - 40)) | (1L << (OPEN - 40)) | (1L << (REQUIRES - 40)) | (1L << (EXPORTS - 40)) | (1L << (OPENS - 40)) | (1L << (TO - 40)) | (1L << (USES - 40)) | (1L << (PROVIDES - 40)) | (1L << (WITH - 40)) | (1L << (TRANSITIVE - 40)) | (1L << (VAR - 40)) | (1L << (YIELD - 40)) | (1L << (RECORD - 40)) | (1L << (SEALED - 40)) | (1L << (PERMITS - 40)) | (1L << (DECIMAL_LITERAL - 40)) | (1L << (HEX_LITERAL - 40)) | (1L << (OCT_LITERAL - 40)) | (1L << (BINARY_LITERAL - 40)) | (1L << (FLOAT_LITERAL - 40)) | (1L << (HEX_FLOAT_LITERAL - 40)) | (1L << (BOOL_LITERAL - 40)) | (1L << (CHAR_LITERAL - 40)) | (1L << (STRING_LITERAL - 40)) | (1L << (TEXT_BLOCK - 40)) | (1L << (NULL_LITERAL - 40)) | (1L << (LPAREN - 40)) | (1L << (BANG - 40)) | (1L << (TILDE - 40)) | (1L << (INC - 40)) | (1L << (DEC - 40)) | (1L << (ADD - 40)) | (1L << (SUB - 40)))) != 0) || _la==IDENTIFIER) { + { + setState(116); + expressionList(); + } + } + + setState(119); + match(RPAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IdentifierContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(JavaParser.IDENTIFIER, 0); } + public TerminalNode MODULE() { return getToken(JavaParser.MODULE, 0); } + public TerminalNode OPEN() { return getToken(JavaParser.OPEN, 0); } + public TerminalNode REQUIRES() { return getToken(JavaParser.REQUIRES, 0); } + public TerminalNode EXPORTS() { return getToken(JavaParser.EXPORTS, 0); } + public TerminalNode OPENS() { return getToken(JavaParser.OPENS, 0); } + public TerminalNode TO() { return getToken(JavaParser.TO, 0); } + public TerminalNode USES() { return getToken(JavaParser.USES, 0); } + public TerminalNode PROVIDES() { return getToken(JavaParser.PROVIDES, 0); } + public TerminalNode WITH() { return getToken(JavaParser.WITH, 0); } + public TerminalNode TRANSITIVE() { return getToken(JavaParser.TRANSITIVE, 0); } + public TerminalNode YIELD() { return getToken(JavaParser.YIELD, 0); } + public TerminalNode SEALED() { return getToken(JavaParser.SEALED, 0); } + public TerminalNode PERMITS() { return getToken(JavaParser.PERMITS, 0); } + public TerminalNode RECORD() { return getToken(JavaParser.RECORD, 0); } + public TerminalNode VAR() { return getToken(JavaParser.VAR, 0); } + public IdentifierContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_identifier; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterIdentifier(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitIdentifier(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitIdentifier(this); + else return visitor.visitChildren(this); + } + } + + public final IdentifierContext identifier() throws RecognitionException { + IdentifierContext _localctx = new IdentifierContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_identifier); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(122); + _la = _input.LA(1); + if ( !(((((_la - 51)) & ~0x3f) == 0 && ((1L << (_la - 51)) & ((1L << (MODULE - 51)) | (1L << (OPEN - 51)) | (1L << (REQUIRES - 51)) | (1L << (EXPORTS - 51)) | (1L << (OPENS - 51)) | (1L << (TO - 51)) | (1L << (USES - 51)) | (1L << (PROVIDES - 51)) | (1L << (WITH - 51)) | (1L << (TRANSITIVE - 51)) | (1L << (VAR - 51)) | (1L << (YIELD - 51)) | (1L << (RECORD - 51)) | (1L << (SEALED - 51)) | (1L << (PERMITS - 51)))) != 0) || _la==IDENTIFIER) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralContext extends ParserRuleContext { + public IntegerLiteralContext integerLiteral() { + return getRuleContext(IntegerLiteralContext.class,0); + } + public FloatLiteralContext floatLiteral() { + return getRuleContext(FloatLiteralContext.class,0); + } + public TerminalNode CHAR_LITERAL() { return getToken(JavaParser.CHAR_LITERAL, 0); } + public TerminalNode STRING_LITERAL() { return getToken(JavaParser.STRING_LITERAL, 0); } + public TerminalNode BOOL_LITERAL() { return getToken(JavaParser.BOOL_LITERAL, 0); } + public TerminalNode NULL_LITERAL() { return getToken(JavaParser.NULL_LITERAL, 0); } + public TerminalNode TEXT_BLOCK() { return getToken(JavaParser.TEXT_BLOCK, 0); } + public LiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literal; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final LiteralContext literal() throws RecognitionException { + LiteralContext _localctx = new LiteralContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_literal); + try { + setState(131); + _errHandler.sync(this); + switch (_input.LA(1)) { + case DECIMAL_LITERAL: + case HEX_LITERAL: + case OCT_LITERAL: + case BINARY_LITERAL: + enterOuterAlt(_localctx, 1); + { + setState(124); + integerLiteral(); + } + break; + case FLOAT_LITERAL: + case HEX_FLOAT_LITERAL: + enterOuterAlt(_localctx, 2); + { + setState(125); + floatLiteral(); + } + break; + case CHAR_LITERAL: + enterOuterAlt(_localctx, 3); + { + setState(126); + match(CHAR_LITERAL); + } + break; + case STRING_LITERAL: + enterOuterAlt(_localctx, 4); + { + setState(127); + match(STRING_LITERAL); + } + break; + case BOOL_LITERAL: + enterOuterAlt(_localctx, 5); + { + setState(128); + match(BOOL_LITERAL); + } + break; + case NULL_LITERAL: + enterOuterAlt(_localctx, 6); + { + setState(129); + match(NULL_LITERAL); + } + break; + case TEXT_BLOCK: + enterOuterAlt(_localctx, 7); + { + setState(130); + match(TEXT_BLOCK); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IntegerLiteralContext extends ParserRuleContext { + public TerminalNode DECIMAL_LITERAL() { return getToken(JavaParser.DECIMAL_LITERAL, 0); } + public TerminalNode HEX_LITERAL() { return getToken(JavaParser.HEX_LITERAL, 0); } + public TerminalNode OCT_LITERAL() { return getToken(JavaParser.OCT_LITERAL, 0); } + public TerminalNode BINARY_LITERAL() { return getToken(JavaParser.BINARY_LITERAL, 0); } + public IntegerLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_integerLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterIntegerLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitIntegerLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitIntegerLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final IntegerLiteralContext integerLiteral() throws RecognitionException { + IntegerLiteralContext _localctx = new IntegerLiteralContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_integerLiteral); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(133); + _la = _input.LA(1); + if ( !(((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (DECIMAL_LITERAL - 67)) | (1L << (HEX_LITERAL - 67)) | (1L << (OCT_LITERAL - 67)) | (1L << (BINARY_LITERAL - 67)))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FloatLiteralContext extends ParserRuleContext { + public TerminalNode FLOAT_LITERAL() { return getToken(JavaParser.FLOAT_LITERAL, 0); } + public TerminalNode HEX_FLOAT_LITERAL() { return getToken(JavaParser.HEX_FLOAT_LITERAL, 0); } + public FloatLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_floatLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterFloatLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitFloatLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitFloatLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final FloatLiteralContext floatLiteral() throws RecognitionException { + FloatLiteralContext _localctx = new FloatLiteralContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_floatLiteral); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(135); + _la = _input.LA(1); + if ( !(_la==FLOAT_LITERAL || _la==HEX_FLOAT_LITERAL) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionListContext extends ParserRuleContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public List COMMA() { return getTokens(JavaParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(JavaParser.COMMA, i); + } + public ExpressionListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).enterExpressionList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaParserListener ) ((JavaParserListener)listener).exitExpressionList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaParserVisitor ) return ((JavaParserVisitor)visitor).visitExpressionList(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionListContext expressionList() throws RecognitionException { + ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_expressionList); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(137); + expression(0); + setState(142); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(138); + match(COMMA); + setState(139); + expression(0); + } + } + setState(144); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 0: + return expression_sempred((ExpressionContext)_localctx, predIndex); + } + return true; + } + private boolean expression_sempred(ExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return precpred(_ctx, 12); + case 1: + return precpred(_ctx, 11); + case 2: + return precpred(_ctx, 10); + case 3: + return precpred(_ctx, 9); + case 4: + return precpred(_ctx, 8); + case 5: + return precpred(_ctx, 7); + case 6: + return precpred(_ctx, 6); + case 7: + return precpred(_ctx, 5); + case 8: + return precpred(_ctx, 4); + case 9: + return precpred(_ctx, 3); + case 10: + return precpred(_ctx, 2); + case 11: + return precpred(_ctx, 1); + case 12: + return precpred(_ctx, 18); + case 13: + return precpred(_ctx, 17); + case 14: + return precpred(_ctx, 15); + } + return true; + } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\u0082\u0094\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\3\2\3\2\3\2"+ + "\3\2\3\2\3\2\3\2\5\2\32\n\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3"+ + "\2\3\2\3\2\3\2\5\2*\n\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3"+ + "\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2"+ + "\3\2\3\2\3\2\3\2\3\2\3\2\3\2\5\2P\n\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\7\2"+ + "Y\n\2\f\2\16\2\\\13\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3f\n\3\3\4\3\4"+ + "\3\4\5\4k\n\4\3\4\3\4\3\4\3\4\3\4\5\4r\n\4\3\4\3\4\3\4\3\4\5\4x\n\4\3"+ + "\4\5\4{\n\4\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6\u0086\n\6\3\7\3\7"+ + "\3\b\3\b\3\t\3\t\3\t\7\t\u008f\n\t\f\t\16\t\u0092\13\t\3\t\2\3\2\n\2\4"+ + "\6\b\n\f\16\20\2\r\3\2fi\3\2\\]\4\2jkoo\3\2hi\4\2Z[ab\4\2``cc\4\2YYpz"+ + "\3\2fg\4\2\65C\u0082\u0082\3\2EH\3\2IJ\2\u00b1\2\31\3\2\2\2\4e\3\2\2\2"+ + "\6z\3\2\2\2\b|\3\2\2\2\n\u0085\3\2\2\2\f\u0087\3\2\2\2\16\u0089\3\2\2"+ + "\2\20\u008b\3\2\2\2\22\23\b\2\1\2\23\32\5\4\3\2\24\32\5\6\4\2\25\26\t"+ + "\2\2\2\26\32\5\2\2\20\27\30\t\3\2\2\30\32\5\2\2\17\31\22\3\2\2\2\31\24"+ + "\3\2\2\2\31\25\3\2\2\2\31\27\3\2\2\2\32Z\3\2\2\2\33\34\f\16\2\2\34\35"+ + "\t\4\2\2\35Y\5\2\2\17\36\37\f\r\2\2\37 \t\5\2\2 Y\5\2\2\16!)\f\f\2\2\""+ + "#\7[\2\2#*\7[\2\2$%\7Z\2\2%&\7Z\2\2&*\7Z\2\2\'(\7Z\2\2(*\7Z\2\2)\"\3\2"+ + "\2\2)$\3\2\2\2)\'\3\2\2\2*+\3\2\2\2+Y\5\2\2\r,-\f\13\2\2-.\t\6\2\2.Y\5"+ + "\2\2\f/\60\f\n\2\2\60\61\t\7\2\2\61Y\5\2\2\13\62\63\f\t\2\2\63\64\7l\2"+ + "\2\64Y\5\2\2\n\65\66\f\b\2\2\66\67\7n\2\2\67Y\5\2\2\t89\f\7\2\29:\7m\2"+ + "\2:Y\5\2\2\b;<\f\6\2\2<=\7d\2\2=Y\5\2\2\7>?\f\5\2\2?@\7e\2\2@Y\5\2\2\6"+ + "AB\f\4\2\2BC\7^\2\2CD\5\2\2\2DE\7_\2\2EF\5\2\2\4FY\3\2\2\2GH\f\3\2\2H"+ + "I\t\b\2\2IY\5\2\2\3JK\f\24\2\2KO\7X\2\2LP\5\b\5\2MP\5\6\4\2NP\7-\2\2O"+ + "L\3\2\2\2OM\3\2\2\2ON\3\2\2\2PY\3\2\2\2QR\f\23\2\2RS\7T\2\2ST\5\2\2\2"+ + "TU\7U\2\2UY\3\2\2\2VW\f\21\2\2WY\t\t\2\2X\33\3\2\2\2X\36\3\2\2\2X!\3\2"+ + "\2\2X,\3\2\2\2X/\3\2\2\2X\62\3\2\2\2X\65\3\2\2\2X8\3\2\2\2X;\3\2\2\2X"+ + ">\3\2\2\2XA\3\2\2\2XG\3\2\2\2XJ\3\2\2\2XQ\3\2\2\2XV\3\2\2\2Y\\\3\2\2\2"+ + "ZX\3\2\2\2Z[\3\2\2\2[\3\3\2\2\2\\Z\3\2\2\2]^\7P\2\2^_\5\2\2\2_`\7Q\2\2"+ + "`f\3\2\2\2af\7-\2\2bf\7*\2\2cf\5\n\6\2df\5\b\5\2e]\3\2\2\2ea\3\2\2\2e"+ + "b\3\2\2\2ec\3\2\2\2ed\3\2\2\2f\5\3\2\2\2gh\5\b\5\2hj\7P\2\2ik\5\20\t\2"+ + "ji\3\2\2\2jk\3\2\2\2kl\3\2\2\2lm\7Q\2\2m{\3\2\2\2no\7-\2\2oq\7P\2\2pr"+ + "\5\20\t\2qp\3\2\2\2qr\3\2\2\2rs\3\2\2\2s{\7Q\2\2tu\7*\2\2uw\7P\2\2vx\5"+ + "\20\t\2wv\3\2\2\2wx\3\2\2\2xy\3\2\2\2y{\7Q\2\2zg\3\2\2\2zn\3\2\2\2zt\3"+ + "\2\2\2{\7\3\2\2\2|}\t\n\2\2}\t\3\2\2\2~\u0086\5\f\7\2\177\u0086\5\16\b"+ + "\2\u0080\u0086\7L\2\2\u0081\u0086\7M\2\2\u0082\u0086\7K\2\2\u0083\u0086"+ + "\7O\2\2\u0084\u0086\7N\2\2\u0085~\3\2\2\2\u0085\177\3\2\2\2\u0085\u0080"+ + "\3\2\2\2\u0085\u0081\3\2\2\2\u0085\u0082\3\2\2\2\u0085\u0083\3\2\2\2\u0085"+ + "\u0084\3\2\2\2\u0086\13\3\2\2\2\u0087\u0088\t\13\2\2\u0088\r\3\2\2\2\u0089"+ + "\u008a\t\f\2\2\u008a\17\3\2\2\2\u008b\u0090\5\2\2\2\u008c\u008d\7W\2\2"+ + "\u008d\u008f\5\2\2\2\u008e\u008c\3\2\2\2\u008f\u0092\3\2\2\2\u0090\u008e"+ + "\3\2\2\2\u0090\u0091\3\2\2\2\u0091\21\3\2\2\2\u0092\u0090\3\2\2\2\16\31"+ + ")OXZejqwz\u0085\u0090"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.tokens b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.tokens new file mode 100644 index 00000000..f811013a --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.tokens @@ -0,0 +1,242 @@ +ABSTRACT=1 +ASSERT=2 +BOOLEAN=3 +BREAK=4 +BYTE=5 +CASE=6 +CATCH=7 +CHAR=8 +CLASS=9 +CONST=10 +CONTINUE=11 +DEFAULT=12 +DO=13 +DOUBLE=14 +ELSE=15 +ENUM=16 +EXTENDS=17 +FINAL=18 +FINALLY=19 +FLOAT=20 +FOR=21 +IF=22 +GOTO=23 +IMPLEMENTS=24 +IMPORT=25 +INSTANCEOF=26 +INT=27 +INTERFACE=28 +LONG=29 +NATIVE=30 +NEW=31 +PACKAGE=32 +PRIVATE=33 +PROTECTED=34 +PUBLIC=35 +RETURN=36 +SHORT=37 +STATIC=38 +STRICTFP=39 +SUPER=40 +SWITCH=41 +SYNCHRONIZED=42 +THIS=43 +THROW=44 +THROWS=45 +TRANSIENT=46 +TRY=47 +VOID=48 +VOLATILE=49 +WHILE=50 +MODULE=51 +OPEN=52 +REQUIRES=53 +EXPORTS=54 +OPENS=55 +TO=56 +USES=57 +PROVIDES=58 +WITH=59 +TRANSITIVE=60 +VAR=61 +YIELD=62 +RECORD=63 +SEALED=64 +PERMITS=65 +NON_SEALED=66 +DECIMAL_LITERAL=67 +HEX_LITERAL=68 +OCT_LITERAL=69 +BINARY_LITERAL=70 +FLOAT_LITERAL=71 +HEX_FLOAT_LITERAL=72 +BOOL_LITERAL=73 +CHAR_LITERAL=74 +STRING_LITERAL=75 +TEXT_BLOCK=76 +NULL_LITERAL=77 +LPAREN=78 +RPAREN=79 +LBRACE=80 +RBRACE=81 +LBRACK=82 +RBRACK=83 +SEMI=84 +COMMA=85 +DOT=86 +ASSIGN=87 +GT=88 +LT=89 +BANG=90 +TILDE=91 +QUESTION=92 +COLON=93 +EQUAL=94 +LE=95 +GE=96 +NOTEQUAL=97 +AND=98 +OR=99 +INC=100 +DEC=101 +ADD=102 +SUB=103 +MUL=104 +DIV=105 +BITAND=106 +BITOR=107 +CARET=108 +MOD=109 +ADD_ASSIGN=110 +SUB_ASSIGN=111 +MUL_ASSIGN=112 +DIV_ASSIGN=113 +AND_ASSIGN=114 +OR_ASSIGN=115 +XOR_ASSIGN=116 +MOD_ASSIGN=117 +LSHIFT_ASSIGN=118 +RSHIFT_ASSIGN=119 +URSHIFT_ASSIGN=120 +ARROW=121 +COLONCOLON=122 +AT=123 +ELLIPSIS=124 +WS=125 +COMMENT=126 +LINE_COMMENT=127 +IDENTIFIER=128 +'abstract'=1 +'assert'=2 +'boolean'=3 +'break'=4 +'byte'=5 +'case'=6 +'catch'=7 +'char'=8 +'class'=9 +'const'=10 +'continue'=11 +'default'=12 +'do'=13 +'double'=14 +'else'=15 +'enum'=16 +'extends'=17 +'final'=18 +'finally'=19 +'float'=20 +'for'=21 +'if'=22 +'goto'=23 +'implements'=24 +'import'=25 +'instanceof'=26 +'int'=27 +'interface'=28 +'long'=29 +'native'=30 +'new'=31 +'package'=32 +'private'=33 +'protected'=34 +'public'=35 +'return'=36 +'short'=37 +'static'=38 +'strictfp'=39 +'super'=40 +'switch'=41 +'synchronized'=42 +'this'=43 +'throw'=44 +'throws'=45 +'transient'=46 +'try'=47 +'void'=48 +'volatile'=49 +'while'=50 +'module'=51 +'open'=52 +'requires'=53 +'exports'=54 +'opens'=55 +'to'=56 +'uses'=57 +'provides'=58 +'with'=59 +'transitive'=60 +'var'=61 +'yield'=62 +'record'=63 +'sealed'=64 +'permits'=65 +'non-sealed'=66 +'null'=77 +'('=78 +')'=79 +'{'=80 +'}'=81 +'['=82 +']'=83 +';'=84 +','=85 +'.'=86 +'='=87 +'>'=88 +'<'=89 +'!'=90 +'~'=91 +'?'=92 +':'=93 +'=='=94 +'<='=95 +'>='=96 +'!='=97 +'&&'=98 +'||'=99 +'++'=100 +'--'=101 +'+'=102 +'-'=103 +'*'=104 +'/'=105 +'&'=106 +'|'=107 +'^'=108 +'%'=109 +'+='=110 +'-='=111 +'*='=112 +'/='=113 +'&='=114 +'|='=115 +'^='=116 +'%='=117 +'<<='=118 +'>>='=119 +'>>>='=120 +'->'=121 +'::'=122 +'@'=123 +'...'=124 diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseListener.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseListener.java new file mode 100644 index 00000000..a5ff0453 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseListener.java @@ -0,0 +1,135 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link JavaParserListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +public class JavaParserBaseListener implements JavaParserListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpression(JavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpression(JavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPrimary(JavaParser.PrimaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPrimary(JavaParser.PrimaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodCall(JavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodCall(JavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifier(JavaParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifier(JavaParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteral(JavaParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteral(JavaParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFloatLiteral(JavaParser.FloatLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFloatLiteral(JavaParser.FloatLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionList(JavaParser.ExpressionListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionList(JavaParser.ExpressionListContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseVisitor.java new file mode 100644 index 00000000..7520a4c4 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserBaseVisitor.java @@ -0,0 +1,70 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link JavaParserVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public class JavaParserBaseVisitor extends AbstractParseTreeVisitor implements JavaParserVisitor { + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpression(JavaParser.ExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPrimary(JavaParser.PrimaryContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMethodCall(JavaParser.MethodCallContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdentifier(JavaParser.IdentifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLiteral(JavaParser.LiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFloatLiteral(JavaParser.FloatLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpressionList(JavaParser.ExpressionListContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserListener.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserListener.java new file mode 100644 index 00000000..b2a9fd90 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserListener.java @@ -0,0 +1,90 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link JavaParser}. + */ +public interface JavaParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + */ + void enterExpression(JavaParser.ExpressionContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + */ + void exitExpression(JavaParser.ExpressionContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + */ + void enterPrimary(JavaParser.PrimaryContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + */ + void exitPrimary(JavaParser.PrimaryContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + */ + void enterMethodCall(JavaParser.MethodCallContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + */ + void exitMethodCall(JavaParser.MethodCallContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + */ + void enterIdentifier(JavaParser.IdentifierContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + */ + void exitIdentifier(JavaParser.IdentifierContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + */ + void enterLiteral(JavaParser.LiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + */ + void exitLiteral(JavaParser.LiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + */ + void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + */ + void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + */ + void enterFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + */ + void exitFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + */ + void enterExpressionList(JavaParser.ExpressionListContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + */ + void exitExpressionList(JavaParser.ExpressionListContext ctx); +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserVisitor.java new file mode 100644 index 00000000..8ebd85c0 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParserVisitor.java @@ -0,0 +1,61 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link JavaParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface JavaParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpression(JavaParser.ExpressionContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPrimary(JavaParser.PrimaryContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodCall(JavaParser.MethodCallContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifier(JavaParser.IdentifierContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteral(JavaParser.LiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionList(JavaParser.ExpressionListContext ctx); +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java new file mode 100644 index 00000000..223b9a7d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java @@ -0,0 +1,332 @@ +package org.javabip.verification.visitors; + +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.antlr.v4.runtime.tree.TerminalNodeImpl; +import org.javabip.verification.ast.*; +import org.javabip.verification.parser.JavaParser; +import org.javabip.verification.parser.JavaParserBaseVisitor; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +public class ExpressionASTBuilder extends JavaParserBaseVisitor { + + public ParsedJavaExpression build(ParseTree t) { + return (ParsedJavaExpression) t.accept(this); + } + + @Override + public ParsedJavaExpression visitTerminal(TerminalNode node) { + String text = node.getText(); + switch (text) { + case "this": { + return new ThisExpression(); + } + case "super": { + return new SuperExpression(); + } + case "++": + case "--": { + return new StringExpression(text); + } + default: { + //TODO error + } + } + + return null; + } + + @Override + public ParsedJavaExpression visitExpression(JavaParser.ExpressionContext ctx) { + List children = ctx.children; + if (children == null){ + //TODO exception + } + + switch (children.size()) { + case 1: { + // cases: primary, methodCall + return (ParsedJavaExpression) children.get(0).accept(this); + } + case 2: { + //case: prefix and postfix + return buildPreAndPostfixExpression(children); + } + case 3: { + //case: binary expressions + return buildBinaryExpression(children); + + } + case 4: { + // case: expression '[' expression ']' + return buildArrayExpression(children); + } + case 5: { + //case: ternary expression + //TODO ternary expression + } + default: { + //TODO error + } + } + + for (ParseTree ch : children) { + Object accept = ch.accept(this); + } + return null; + //TODO throw an exception + } + + @Override + public ParsedJavaExpression visitPrimary(JavaParser.PrimaryContext ctx) { + List children = ctx.children; + int i = children.size(); + switch (i) { + case 1: { + ParseTree parseTree = children.get(0); + if (parseTree instanceof TerminalNodeImpl) { + + return visitTerminal((TerminalNodeImpl) parseTree); + //TODO keep track that only this and super can be processed. Interface? + + /*String text = parseTree.getText(); + switch (text){ + case "this": { + return (ParsedJavaExpression) new ThisExpression(); + } + case "super": { + return (ParsedJavaExpression) new SuperExpression(); + } + default: { + //TODO error + } + }*/ + } + + return (ParsedJavaExpression) parseTree.accept(this); + } + case 3: { + ParseTree parseTree = ctx.children.get(1); + return ((ParsedJavaExpression) parseTree.accept(this)); + } + default: { + //TODO Exception + } + } + + + return null; + } + + @Override + public ParsedJavaExpression visitMethodCall(JavaParser.MethodCallContext ctx) { + //parse methodBase + ParsedJavaExpression methodBase = build(ctx.children.get(0)); + if (!(methodBase instanceof MethodCallBase)) { + //TODO throw error + } + + //parse arguments if present + ArrayList arguments = new ArrayList<>(); + JavaParser.ExpressionListContext expressionListContext = ctx.expressionList(); + if (expressionListContext != null) { + expressionListContext.children.forEach(arg -> arguments.add(build(arg))); + } + List argumentsNotNull = arguments.stream().filter(Objects::nonNull).collect(Collectors.toList()); + + return new MethodCallExpression((MethodCallBase) methodBase, (ArrayList) argumentsNotNull); + } + + @Override + public ParsedJavaExpression visitIdentifier(JavaParser.IdentifierContext ctx) { + TerminalNode identifier = ctx.IDENTIFIER(); + if (identifier != null) { + return new IdentifierExpression(identifier.getText()); + } + + return null; + //TODO should throw error since we are not interested in any other terminals that identifier + } + + @Override + public ParsedJavaExpression visitLiteral(JavaParser.LiteralContext ctx) { + ParseTree literal = ctx.children.get(0); + if (literal instanceof TerminalNodeImpl) { + TerminalNode charLiteral = ctx.CHAR_LITERAL(); + if (charLiteral != null) { + return (ParsedJavaExpression) new StringExpression(charLiteral.toString().replace("'", "")); + } + + TerminalNode stringLiteral = ctx.STRING_LITERAL(); + if (stringLiteral != null) { + + + return (ParsedJavaExpression) new StringExpression(stringLiteral.toString().replace("\"", "")); + } + + TerminalNode boolLiteral = ctx.BOOL_LITERAL(); + if (boolLiteral != null) { + return (ParsedJavaExpression) new BooleanExpression(Boolean.parseBoolean(boolLiteral.toString())); + } + + + TerminalNode nullLiteral = ctx.NULL_LITERAL(); + if (nullLiteral != null) { + return (ParsedJavaExpression) new NullExpression(); + } + + TerminalNode textBlockLiteral = ctx.TEXT_BLOCK(); + if (textBlockLiteral != null) { + //TODO NOT IMPLEMENTED + } + + return null; + //TODO this is incorrect, an error should be thrown here + } else + return (ParsedJavaExpression) literal.accept(this); + } + + @Override + public ParsedJavaExpression visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { + TerminalNode decInt = ctx.DECIMAL_LITERAL(); + + if (decInt != null) { + return new IntegerExpression(Integer.parseInt(decInt.getText()), IntegerExpression.IntegerType.DECIMAL_LITERAL); + } + + TerminalNode binInt = ctx.BINARY_LITERAL(); + if (binInt != null) { + return new IntegerExpression(Integer.parseInt(binInt.getText()), IntegerExpression.IntegerType.BINARY_LITERAL); + } + + TerminalNode hexInt = ctx.HEX_LITERAL(); + if (hexInt != null) { + return new IntegerExpression(Integer.parseInt(hexInt.getText()), IntegerExpression.IntegerType.HEX_LITERAL); + } + + TerminalNode octInt = ctx.OCT_LITERAL(); + if (octInt != null) { + return new IntegerExpression(Integer.parseInt(octInt.getText()), IntegerExpression.IntegerType.OCT_LITERAL); + } + + return null; + //TODO this is incorrect, an error should be thrown here + + } + + @Override + public ParsedJavaExpression visitFloatLiteral(JavaParser.FloatLiteralContext ctx) { + TerminalNode floatLiteral = ctx.FLOAT_LITERAL(); + if (floatLiteral != null) { + return new FloatExpression(Float.parseFloat(floatLiteral.getText()), FloatExpression.FloatType.FLOAT); + } + + TerminalNode hexFloatLiteral = ctx.HEX_FLOAT_LITERAL(); + if (hexFloatLiteral != null) { + return new FloatExpression(Float.parseFloat(hexFloatLiteral.getText()), FloatExpression.FloatType.HEX_FLOAT); + } + + return null; + //TODO this is incorrect, an error should be thrown herereturn null; + } + + @Override + public ParsedJavaExpression visitExpressionList(JavaParser.ExpressionListContext ctx) { + return null; + } + + private ParsedJavaExpression buildBinaryExpression(List children) { + ParsedJavaExpression left = build(children.get(0)); + ParsedJavaExpression right = build(children.get(2)); + + ParseTree separatorTree = children.get(1); + if (separatorTree instanceof TerminalNodeImpl) { + String value = separatorTree.getText(); + switch (value) { + case ".": { + // case: afterDotExpression + if (right instanceof AfterDotExpression) { + return new DotSeparatedExpression(left, (AfterDotExpression) right); + } else { + //TODO error + } + break; + } + case "==": + case "!=": { + return new EqualityExpression(left, right, value); + } + case "||": + case "&&": { + return new LogicalExpression(left, right, value); + } + case "<": + case ">": + case "<=": + case "=>": { + return new RelationalExpression(left, right, value); + } + case "+": + case "-": { + return new SumExpression(left, right, value); + } + case "*": + case "/": + case "%": { + return new ProductExpression(left, right, value); + } + case "|": + case "^": + case "&": + case ">>": + case ">>>": + case "<<": { + return new BitBinaryExpression(left, right, value); + } + } + } else { + //TODO error + } + return null; + } + + private ParsedJavaExpression buildPreAndPostfixExpression(List children) { + Utils utils = new Utils(); + ParseTree partOne = children.get(0); + if (partOne instanceof TerminalNodeImpl){ //its prefix + String value = partOne.getText(); + if (utils.inPrefixes(value)) { + ParsedJavaExpression partTwo = (ParsedJavaExpression) children.get(1).accept(this); + return new PrefixExpression(partTwo, value); + } else{ + //TODO wrong prefix, error + } + } else { + ParseTree partTwo = children.get(1); + if (partTwo instanceof TerminalNodeImpl) { //its postfix + String value = partTwo.getText(); + if (utils.inPostfixes(value)) { + ParsedJavaExpression partOneExpression = (ParsedJavaExpression) partOne.accept(this); + return new PrefixExpression(partOneExpression, value); + + } else { + //otherwise it is malformed + //TODO error + } + } + } + + //TODO error + return null; + } + + private ParsedJavaExpression buildArrayExpression(List children) { + ParsedJavaExpression outerExpression = build(children.get(0)); + ParsedJavaExpression innerExpression = build(children.get(2)); + return new ArrayExpression(outerExpression, innerExpression); + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java new file mode 100644 index 00000000..b06dedf9 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java @@ -0,0 +1,70 @@ +package org.javabip.verification.visitors; + +import org.javabip.verification.ast.*; + +public class PJEEvaluateNumericVisitor implements PJEVisitor { + public Number visit(ParsedJavaExpression e) { + return e.accept(this); + } + + public Number visit(ArrayExpression e){ + return null; + } + public Number visit(BooleanExpression e){ + return null; + } + public Number visit(BitBinaryExpression e){ + return null; + } + public Number visit(DotSeparatedExpression e){ + return null; + } + public Number visit(EqualityExpression e){ + return null; + } + public Number visit(FloatExpression e){ + return null; + } + public Number visit(IdentifierExpression e){ + return null; + } + public Number visit(IntegerExpression e){ + return null; + } + public Number visit(LogicalExpression e){ + return null; + } + public Number visit(MethodCallExpression e){ + return null; + } + public Number visit(NullExpression e){ + return null; + } + public Number visit(PostfixExpression e){ + return null; + } + public Number visit(PrefixExpression e){ + return null; + } + public Number visit(ProductExpression e){ + return null; + } + public Number visit(RelationalExpression e){ + return null; + } + public Number visit(StringExpression e){ + return null; + } + public Number visit(SumExpression e){ + return null; + } + public Number visit(SuperExpression e){ + return null; + } + public Number visit(TernaryExpression e){ + return null; + } + public Number visit(ThisExpression e){ + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateVisitor.java new file mode 100644 index 00000000..73a02ec7 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateVisitor.java @@ -0,0 +1,67 @@ +package org.javabip.verification.visitors; + +import org.javabip.verification.ast.*; + +public class PJEEvaluateVisitor implements PJEVisitor { + public Boolean visit(ArrayExpression e){ + return false; + } + + public Object visit(BooleanExpression e){ + return false; + } + public Object visit(BitBinaryExpression e){ + return false; + } + public Object visit(DotSeparatedExpression e){ + return false; + } + public Object visit(EqualityExpression e){ + return false; + } + public Object visit(FloatExpression e){ + return false; + } + public Object visit(IdentifierExpression e){ + return false; + } + public Object visit(IntegerExpression e){ + return false; + } + public Object visit(LogicalExpression e){ + return false; + } + public Object visit(MethodCallExpression e){ + return false; + } + public Object visit(NullExpression e){ + return false; + } + public Object visit(PostfixExpression e){ + return false; + } + public Object visit(PrefixExpression e){ + return false; + } + public Object visit(ProductExpression e){ + return false; + } + public Object visit(RelationalExpression e){ + return false; + } + public Object visit(StringExpression e){ + return false; + } + public Object visit(SumExpression e){ + return false; + } + public Object visit(SuperExpression e){ + return false; + } + public Object visit(TernaryExpression e){ + return false; + } + public Object visit(ThisExpression e){ + return false; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEVisitor.java new file mode 100644 index 00000000..e4aa9854 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEVisitor.java @@ -0,0 +1,26 @@ +package org.javabip.verification.visitors; + +import org.javabip.verification.ast.*; + +public interface PJEVisitor { + R visit(ArrayExpression e); + R visit(BooleanExpression e); + R visit(BitBinaryExpression e); + R visit(DotSeparatedExpression e); + R visit(EqualityExpression e); + R visit(FloatExpression e); + R visit(IdentifierExpression e); + R visit(IntegerExpression e); + R visit(LogicalExpression e); + R visit(MethodCallExpression e); + R visit(NullExpression e); + R visit(PostfixExpression e); + R visit(PrefixExpression e); + R visit(ProductExpression e); + R visit(RelationalExpression e); + R visit(StringExpression e); + R visit(SumExpression e); + R visit(SuperExpression e); + R visit(TernaryExpression e); + R visit(ThisExpression e); +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEWellformednessChecker.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEWellformednessChecker.java new file mode 100644 index 00000000..4c026f91 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEWellformednessChecker.java @@ -0,0 +1,66 @@ +package org.javabip.verification.visitors; + +import org.javabip.verification.ast.*; + +public class PJEWellformednessChecker implements PJEVisitor { + public Boolean visit(ArrayExpression e){ + return false; + } + public Boolean visit(BooleanExpression e){ + return false; + } + public Boolean visit(BitBinaryExpression e){ + return false; + } + public Boolean visit(DotSeparatedExpression e){ + return false; + } + public Boolean visit(EqualityExpression e){ + return false; + } + public Boolean visit(FloatExpression e){ + return false; + } + public Boolean visit(IdentifierExpression e){ + return false; + } + public Boolean visit(IntegerExpression e){ + return false; + } + public Boolean visit(LogicalExpression e){ + return false; + } + public Boolean visit(MethodCallExpression e){ + return false; + } + public Boolean visit(NullExpression e){ + return false; + } + public Boolean visit(PostfixExpression e){ + return false; + } + public Boolean visit(PrefixExpression e){ + return false; + } + public Boolean visit(ProductExpression e){ + return false; + } + public Boolean visit(RelationalExpression e){ + return false; + } + public Boolean visit(StringExpression e){ + return false; + } + public Boolean visit(SumExpression e){ + return false; + } + public Boolean visit(SuperExpression e){ + return false; + } + public Boolean visit(TernaryExpression e){ + return false; + } + public Boolean visit(ThisExpression e){ + return false; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java new file mode 100644 index 00000000..13baa39d --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java @@ -0,0 +1,167 @@ +package org.javabip.verification.visitors.test; + +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; +import org.javabip.verification.ast.ParsedJavaExpression; +import org.javabip.verification.parser.JavaLexer; +import org.javabip.verification.parser.JavaParser; +import org.javabip.verification.visitors.ExpressionASTBuilder; +import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class PJEEvaluateNumericVisitorTest { + private Number go(String test) { + JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); + JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); + JavaParser.ExpressionContext expression = parser.expression(); + ExpressionASTBuilder v = new ExpressionASTBuilder(); + ParsedJavaExpression invariantParsedExpression = v.build(expression); + + FakeInvariantImpl invariant = new FakeInvariantImpl(test, invariantParsedExpression); + Number result = invariant.evaluateNumericExpression(); + + System.out.println(result); + return result; + } + + static class FakeInvariantImpl { + + private final String expression; + + private final ParsedJavaExpression parsedExpression; + + public FakeInvariantImpl(String expression, ParsedJavaExpression invariantParsedExpression) { + this.expression =expression; + this.parsedExpression = invariantParsedExpression; + } + + public String expr() { + return expression; + } + + public String toString() { + return "Invariant=(expr = " + expr() + ")"; + } + + public Number evaluateNumericExpression() { + return parsedExpression.accept(new PJEEvaluateNumericVisitor()); + } + } + + @Test + public void testBooleanExpressionFalse(){ + go("false"); + //null + } + + @Test + public void testBooleanExpressionTrue(){ + go("true"); + //null + } + + @Test + public void testArrayExpression(){ + } + + @Test + public void testBinaryExpression () { + } + + @Test + public void testBooleanExpression(){ + } + + @Test + public void testBitBinaryExpression(){ + + } + + @Test + public void testDotSeparatedExpression(){ + + } + + @Test + public void testEqualityExpression(){ + + } + + @Test + public void testFloatExpression(){ + + } + + @Test + public void testIdentifierExpression(){ + + } + + @Test + public void testIntegerExpression(){ + + } + + @Test + public void testLogicalExpression(){ + + } + + @Test + public void testMethodCallExpression(){ + + } + + @Test + public void testNullExpression(){ + + } + + @Test + public void testPostfixExpression(){ + + } + + @Test + public void testPrefixExpression(){ + + } + + @Test + public void testProductExpression(){ + + } + + @Test + public void testRelationalExpression(){ + + } + + @Test + public void testStringExpression(){ + + } + + @Test + public void testSumExpression(){ + + } + + @Test + public void testSuperExpression(){ + + } + + @Test + public void testTernaryExpression(){ + + } + + @Test + public void testThisExpression(){ + + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java new file mode 100644 index 00000000..a4f1440e --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java @@ -0,0 +1,238 @@ +package org.javabip.verification.visitors.test; + +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; +import org.javabip.annotations.*; +import org.javabip.verification.ast.*; +import org.javabip.verification.parser.JavaLexer; +import org.javabip.verification.parser.JavaParser; +import org.javabip.verification.visitors.ExpressionASTBuilder; +import org.javabip.verification.visitors.PJEEvaluateVisitor; +import org.junit.Test; + +import java.util.ArrayList; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class PJEEvaluateVisitorTest { + private boolean go(String test) { + JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); + JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); + JavaParser.ExpressionContext expression = parser.expression(); + ExpressionASTBuilder v = new ExpressionASTBuilder(); + ParsedJavaExpression invariantParsedExpression = v.build(expression); + + FakeInvariantImpl invariant = new FakeInvariantImpl(test, invariantParsedExpression); + Boolean result = invariant.evaluateInvariant(); + + System.out.println(test); + return result; + } + + static class FakeInvariantImpl { + private final String expression; + private final ParsedJavaExpression parsedExpression; + + public FakeInvariantImpl(String expression, ParsedJavaExpression invariantParsedExpression) { + this.expression = expression; + this.parsedExpression = invariantParsedExpression; + } + + public String expr() { + return expression; + } + + public String toString() { + return "Invariant=(expr = " + expr() + ")"; + } + + public Boolean evaluateInvariant() { + return (Boolean) parsedExpression.accept(new PJEEvaluateVisitor()); + } + + public Boolean evaluateInvariant(Class componentClass, Object bipComponent) { + return (Boolean) parsedExpression.accept(new PJEEvaluateVisitor()); + } + } + + static class FakeSpecification { + Float bet; + Integer operator; + int pot; + String secretNumber; + Boolean win; + + public FakeSpecification(Float bet, Integer operator, int pot, String secretNumber, Boolean win) { + this.bet = bet; + this.operator = operator; + this.pot = pot; + this.secretNumber = secretNumber; + this.win = win; + } + + public Float getBet() { + return bet; + } + + public void setBet(Float bet) { + this.bet = bet; + } + + public Integer getOperator() { + return operator; + } + + public void setOperator(Integer operator) { + this.operator = operator; + } + + public int getPot() { + return pot; + } + + public void setPot(int pot) { + this.pot = pot; + } + + public String getSecretNumber() { + return secretNumber; + } + + public void setSecretNumber(String secretNumber) { + this.secretNumber = secretNumber; + } + + public Boolean getWin() { + return win; + } + + public void setWin(Boolean win) { + this.win = win; + } + } + + //region Basic Types Tests + @Test + public void testBooleanExpressionFalse() { + String test = "true && false"; + assertFalse(go(test)); + } + + @Test + public void testBooleanExpressionTrue() { + String test = "true || false"; + assertTrue(go(test)); + } + + @Test + public void testBooleanExpressionParent() { + String test = "(true || false) && true"; + assertTrue(go(test)); + } + + @Test + public void testNumberExpression() { + String test = "5 > 1.0"; + assertTrue(go(test)); + } + + @Test + public void testEqualityExpressionString() { + String test = "\"apple\" != \"pear\""; + assertTrue(go(test)); + } + + @Test + public void testEqualityExpressionChar() { + String test = "'a' == 'a'"; + assertTrue(go(test)); + } + + @Test + public void testEqualityExpressionNumber() { + String test = "1 == 1.0"; + assertTrue(go(test)); + } + + @Test + public void testNullExpression() { + String test = "\"null\" != null"; + assertTrue(go(test)); + } + + @Test + public void testProductExpression() { + String test = "1 * 1 == 1"; + assertTrue(go(test)); + } + + @Test + public void testProductExpressionFail() { + String test = "1 / 0 == null"; + assertTrue(go(test)); + } + + @Test + public void testSumExpressionNumber() { + String test = "1 + 1 == 2"; + assertTrue(go(test)); + } + + @Test + public void testSumExpressionString() { + String test = "\"1\" + \"1\" == \"11\""; + assertTrue(go(test)); + } + + @Test + public void testTernaryExpression() { + //TODO ternary implementation does not work + String test = "1 + 1 == 2 ? true : false"; + assertTrue(go(test)); + } + + @Test + public void testBitBinaryExpression() { /*TODO to be implemented*/ } + //endregion + + //region Field Accessing Tests + @Test + public void testIdentifierExpression() { + } + + @Test + public void testSuperExpression() { + //TODO + //in fact should not be supported + } + + @Test + public void testThisExpression() { + //TODO + // in fact "this.value" is just a syntactic sugar for "value" + String test = "this.value"; + assertFalse(go(test)); + } + + @Test + public void testMethodCallExpression() { + } + + @Test + public void testDotSeparatedExpression() { + } + + @Test + public void testArrayExpression() { + } + + @Test + public void testPostfixExpression() { + } + + @Test + public void testPrefixExpression() { + } + //endregion +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java new file mode 100644 index 00000000..6a3a3f78 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java @@ -0,0 +1,203 @@ +package org.javabip.verification.visitors.test; + +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; +import org.javabip.verification.ast.ParsedJavaExpression; +import org.javabip.verification.parser.JavaLexer; +import org.javabip.verification.parser.JavaParser; +import org.javabip.verification.visitors.ExpressionASTBuilder; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ParsedJavaExpressionASTBuilderTest { + private String go(String test) { + JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); + JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); + JavaParser.ExpressionContext expression = parser.expression(); + ExpressionASTBuilder v = new ExpressionASTBuilder(); + ParsedJavaExpression result = v.build(expression); + System.out.println(result); + return result.toString(); + } + + @Test + public void testThis(){ + String test = "this"; + assertEquals(go(test), test); + } + + @Test + public void testSuper(){ + String test = "super"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralIntegerDecimal(){ + String test = "1"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralIntegerBinary(){ + //TODO + } + + @Test + public void testLiteralIntegerOct(){ + //TODO + } + + @Test + public void testLiteralIntegerHex(){ + //TODO + } + + @Test + public void testLiteralDouble(){ + String test = "1.0"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralFloat(){ + String test = "1.0f"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralFloatHex(){ + //TODO + } + + @Test + public void testLiteralChar(){ + String test = "'a'"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralString(){ + String test = "\"Hello, world!\""; + assertEquals(go(test), test); + } + + @Test + public void testLiteralNull(){ + String test = "null"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralBoolTrue(){ + String test = "true"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralBoolFalse(){ + String test = "false"; + assertEquals(go(test), test); + } + + @Test + public void testLiteralTextBlock(){ + //TODO + } + + @Test + public void testPrimaryParentheses(){ + //TODO + } + + @Test + public void testIdentifier(){ + String test = "idName"; + assertEquals(go(test), test); + } + + @Test + public void testMethodId(){ + String test = "go()"; + assertEquals(go(test), test); + } + + @Test + public void testMethodThis(){ + String test = "this()"; + assertEquals(go(test), test); + } + + @Test + public void testMethodSuper(){ + String test = "super()"; + assertEquals(go(test), test); + } + + @Test + public void testMethodWithArguments(){ + String test = "go(true, 1)"; + assertEquals(go(test), test); + } + + @Test + public void testArray(){ + String test = "values[0]"; + assertEquals(go(test), test); + } + + @Test + public void testPostfix(){ + String test = "count++"; + assertEquals(go(test), test); + } + + @Test + public void testPrefix(){ + String test = "!true"; + assertEquals(go(test), test); + } + + @Test + public void testSum(){ + String test = "1+a"; + assertEquals(go(test), test); + } + + @Test + public void tesProduct(){ + String test = "this.count * go(true)"; + assertEquals(go(test), test); + } + + @Test + public void tesEq(){ + String test = "a==b"; + assertEquals(go(test), test); + } + + @Test + public void tesNeq(){ + String test = "false!=true"; + assertEquals(go(test), test); + } + + @Test + public void tesDot(){ + String test = "this.count().size"; + assertEquals(go(test), test); + } + + @Test + public void tesRel(){ + String test = "a>b"; + assertEquals(go(test), test); + } + + @Test + public void tesLogic(){ + String test = "a||b"; + assertEquals(go(test), test); + } +} From 80db04604b47d79875367e7ecbf4f593916a94c4 Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 15:31:35 +0200 Subject: [PATCH 13/19] new examples --- .../java/org/javabip/spec/casino/Casino.java | 147 ++++++++++++++++ .../org/javabip/spec/casino/Constants.java | 64 +++++++ .../java/org/javabip/spec/casino/Main.java | 75 ++++++++ .../org/javabip/spec/casino/Operator.java | 91 ++++++++++ .../java/org/javabip/spec/casino/Player.java | 67 +++++++ .../spec/deviation/CalculatorSpec.java | 76 ++++++++ .../org/javabip/spec/deviation/Constants.java | 37 ++++ .../javabip/spec/deviation/DeviatorSpec.java | 32 ++++ .../javabip/spec/deviation/GeneratorSpec.java | 50 ++++++ .../java/org/javabip/spec/deviation/Main.java | 45 +++++ .../java/org/javabip/spec/ping/Constants.java | 22 +++ .../main/java/org/javabip/spec/ping/Main.java | 38 ++++ .../org/javabip/spec/ping/PingCmdSpec.java | 38 ++++ .../org/javabip/spec/ping/PingUserSpec.java | 25 +++ .../javabip/spec/ringelection/Constants.java | 67 +++++++ .../spec/ringelection/ProcessMessage.java | 21 +++ .../spec/ringelection/ProcessSpec.java | 163 ++++++++++++++++++ .../javabip/spec/ringelection/RingBIP.java | 113 ++++++++++++ 18 files changed, 1171 insertions(+) create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Constants.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Main.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/CalculatorSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Constants.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/DeviatorSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/GeneratorSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Main.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Constants.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Main.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingCmdSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingUserSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/Constants.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessMessage.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java create mode 100644 org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/RingBIP.java diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java new file mode 100644 index 00000000..5dcc4f23 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java @@ -0,0 +1,147 @@ +package org.javabip.spec.casino; + +import org.javabip.annotations.*; +import org.javabip.api.DataOut; +import org.javabip.api.PortType; + +import static org.javabip.spec.casino.Coin.HEADS; +import static org.javabip.spec.casino.Coin.TAILS; +import static org.javabip.spec.casino.Constants.*; + +@Ports({ + @Port(name = ADD_TO_POT, type = PortType.enforceable), + @Port(name = REMOVE_FROM_POT, type = PortType.enforceable), + @Port(name = CREATE_GAME, type = PortType.enforceable), + @Port(name = RECEIVE_BET, type = PortType.enforceable), + @Port(name = CASINO_WIN, type = PortType.enforceable), + @Port(name = PLAYER_WIN, type = PortType.enforceable), +}) + +@ComponentType(initial = IDLE, name = CASINO_SPEC) +@Invariant(expr = "bet >= 0 && pot >= bet") +@StatePredicates({ + @StatePredicate(state = IDLE, expr = "false"), + @StatePredicate(state = GAME_AVAILABLE, expr = "true"), + @StatePredicate(state = BET_PLACED, expr = "guess != null") +}) +public class Casino { + final Integer id; + Integer operator; + Integer pot; + Integer secret; + Integer player; + + Coin guess; + int bet; + + public Casino(Integer id, Integer operator) { + this.id = id; + this.operator = operator; + pot = 0; + bet = 0; + System.out.println("CASINO" + id + ": INITIALIZED"); + } + + // Add money to pot + @Transitions({ + @Transition(name = ADD_TO_POT, source = IDLE, target = IDLE, guard = IS_OPERATOR), + @Transition(name = ADD_TO_POT, source = GAME_AVAILABLE, target = GAME_AVAILABLE, guard = IS_OPERATOR), + @Transition(name = ADD_TO_POT, source = BET_PLACED, target = BET_PLACED, guard = IS_OPERATOR) + }) + public void addToPot(@Data(name = OPERATOR) Integer sender, @Data(name = INCOMING_FUNDS) Integer funds) { + pot = pot + funds; + System.out.println("CASINO" + id + ": " + funds + + " received from operator " + sender + + ", pot: " + pot); + } + + // Remove money from pot + @Transitions({ + @Transition(name = REMOVE_FROM_POT, source = IDLE, target = IDLE, guard = IS_OPERATOR, pre = "bet <= pot", post = "pot >= 0"), + @Transition(name = REMOVE_FROM_POT, source = GAME_AVAILABLE, target = GAME_AVAILABLE, guard = IS_OPERATOR, pre = "bet <= pot", post = "pot >= 0"), + }) + public void removeFromPot(@Data(name = OPERATOR) Integer sender, @Data(name = INCOMING_FUNDS) Integer funds) { + pot = pot - funds; + System.out.println("CASINO" + id + ": " + funds + + " removed by operator " + sender + + ", pot: " + pot); + } + + // Operator opens the game + @Transition(name = CREATE_GAME, source = IDLE, target = GAME_AVAILABLE, guard = IS_OPERATOR, post = "secret != null") + public void createGame(@Data(name = OPERATOR) Integer sender) { + secret = new Integer ((int) (Math.random() * 100)); + System.out.println("CASINO" + id + ": GAME CREATED"); + } + + // Operator receives a bet + @Transition(name = RECEIVE_BET, source = GAME_AVAILABLE, target = BET_PLACED, guard = IS_NOT_OPERATOR, pre = "bet <= pot", post = "bet >= 0 && guess != null") + public void receiveBet(@Data(name = PLAYER) Integer sender, + @Data(name = INCOMING_GUESS) Coin guess, @Data(name = INCOMING_BET) Integer bet) { + player = sender; + this.guess = guess; + this.bet = bet; + System.out.println("CASINO" + id + ": received bet: " + bet + + ", guess: " + guess + + " from player " + player); + } + + @Transition(name = CASINO_WIN, source = BET_PLACED, target = IDLE, guard = "IS_OPERATOR & !GUESSED") + public void casinoWin() { + int won = bet; + pot = pot + bet; + bet = 0; + guess = null; + player = null; + System.out.println("CASINO" + id + ": " + won + " won" + + ", pot: " + pot); + } + + @Transition(name = PLAYER_WIN, source = BET_PLACED, target = IDLE, guard = "IS_OPERATOR & GUESSED & IS_PLAYER") + public void playerWin() { // @Data(name = PLAYER) Integer player, @Data(name = OPERATOR) Integer operator + int lost = bet; + pot = pot - bet; + bet = 0; + guess = null; + player = null; + System.out.println("CASINO" + id + ": " + lost + " lost" + + ", pot: " + pot); + } + + @Pure + @Guard(name = GUESSED) + public boolean isGuessed() { + Coin secret = (this.secret % 2 == 0) ? HEADS : TAILS; + return secret == guess; + } + + @Pure + @Guard(name = IS_OPERATOR) + public boolean isOperator(@Data(name = OPERATOR) Integer sender) { + return sender == operator; + } + + @Pure + @Guard(name = IS_NOT_OPERATOR) + public boolean isNotOperator(@Data(name = PLAYER) Integer sender) { + return sender != operator; + } + + @Pure + @Guard(name = IS_PLAYER) + public boolean isPlayer(@Data(name = PLAYER) Integer sender) { + return sender == player; + } + + @Pure + @Data(name = OUTGOING_MONEY, accessTypePort = DataOut.AccessType.allowed, ports = {PLAYER_WIN}) + public Integer getWin() { + return 2*bet; + } + + @Pure + @Data(name = AVAILABLE_FUNDS) + public Integer getPot() { + return pot; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Constants.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Constants.java new file mode 100644 index 00000000..a3466ed4 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Constants.java @@ -0,0 +1,64 @@ +package org.javabip.spec.casino; + +public class Constants { + public static final String ACTOR_SYSTEM = "ACTOR_SYSTEM"; + public static final String ENGINE = "ENGINE"; + public static final String CASINO_SPEC = "CASINO_SPEC"; + //public static final String CASINO = "CASINO"; + public static final String OPERATOR_SPEC = "OPERATOR_SPEC"; + public static final String PLAYER_SPEC = "PLAYER_SPEC"; + + //states + public static final String OFF = "OFF"; + public static final String IDLE = "IDLE"; + public static final String GAME_AVAILABLE = "GAME_AVAILABLE"; + public static final String BET_PLACED = "BET_PLACED"; + public static final String BET_PREPARED = "BET_PREPARED"; + public static final String PUT_FUNDS = "PUT_FUNDS"; + public static final String WITHDRAW_FUNDS = "WITHDRAW_FUNDS"; + public static final String WORKING = "WORKING"; + public static final String NO_MEASURE = "NO_MEASURE"; + public static final String HAS_MEASURE = "HAS_MEASURE"; + + //transitions + public static final String REMOVE_FROM_POT = "REMOVE_FROM_POT"; + public static final String ADD_TO_POT = "ADD_TO_POT"; + public static final String CREATE_GAME = "CREATE_GAME"; + public static final String PLACE_BET = "PLACE_BET"; + public static final String PREPARE_BET = "PREPARE_BET"; + public static final String RECEIVE_BET = "RECEIVE_BET"; + public static final String DECIDE_BET = "DECIDE_BET"; + public static final String RECEIVE_MONEY = "RECEIVE_MONEY"; + public static final String CASINO_WIN = "CASINO_WIN"; + public static final String PLAYER_WIN = "PLAYER_WIN"; + public static final String PREPARE_TO_ADD = "PICK_AN_AMOUNT"; + public static final String PREPARE_TO_REMOVE = "PREPARE_TO_REMOVE"; + public static final String OPEN_CASINO = "OPEN_CASINO"; + public static final String CLOSE_CASINO = "CLOSE_CASINO"; + + //data + public static final String OPERATOR = "OPERATOR"; + public static final String PLAYER = "PLAYER"; + public static final String ID = "ID"; + public static final String OUTGOING_GUESS = "OUTGOING_GUESS"; + public static final String OUTGOING_BET = "OUTGOING_BET"; + public static final String INCOMING_GUESS = "INCOMING_GUESS"; + public static final String INCOMING_BET = "INCOMING_BET"; + public static final String OUTGOING_MONEY = "OUTGOING_MONEY"; + public static final String INCOMING_MONEY = "INCOMING_MONEY"; + public static final String OUTGOING_FUNDS = "OUTGOING_FUNDS"; + public static final String INCOMING_FUNDS = "INCOMING_FUNDS"; + public static final String AVAILABLE_FUNDS = "AVAILABLE_FUNDS"; + public static final String CASINO = "CASINO"; + + //guards + public static final String IS_PLAYER = "IS_PLAYER"; + public static final String IS_OPERATOR = "IS_OPERATOR"; + public static final String IS_NOT_OPERATOR = "IS_NOT_OPERATOR"; + public static final String IS_CASINO = "IS_CASINO"; + public static final String GUESSED = "GUESSED"; + public static final String NOT_GUESSED = "!GUESSED"; + public static final String ENOUGH_FUNDS = "ENOUGH_FUNDS"; +} + +enum Coin { HEADS, TAILS } diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Main.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Main.java new file mode 100644 index 00000000..e72be09c --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Main.java @@ -0,0 +1,75 @@ +package org.javabip.spec.casino; + +import akka.actor.ActorSystem; +import org.javabip.api.BIPEngine; +import org.javabip.api.BIPGlue; +import org.javabip.engine.factory.EngineFactory; +import org.javabip.glue.TwoSynchronGlueBuilder; + +import static org.javabip.spec.casino.Constants.*; + +public class Main { + public static void main(String[] args) throws Exception { + ActorSystem system = ActorSystem.create(ACTOR_SYSTEM); + EngineFactory engineFactory = new EngineFactory(system); + + BIPGlue glue = new TwoSynchronGlueBuilder() { + @Override + public void configure() { + port(Operator.class, PREPARE_TO_ADD).requiresNothing(); + port(Operator.class, PREPARE_TO_ADD).acceptsNothing(); + port(Operator.class, PREPARE_TO_REMOVE).requiresNothing(); + port(Operator.class, PREPARE_TO_REMOVE).acceptsNothing(); + + synchron(Operator.class, CREATE_GAME).to(Casino.class, CREATE_GAME); + synchron(Operator.class, ADD_TO_POT).to(Casino.class, ADD_TO_POT); + synchron(Operator.class, REMOVE_FROM_POT).to(Casino.class, REMOVE_FROM_POT); + + synchron(Casino.class, RECEIVE_BET).to(Player.class, PLACE_BET); + + port(Operator.class, DECIDE_BET).requires(Casino.class, CASINO_WIN); + port(Casino.class, CASINO_WIN).requires(Operator.class, DECIDE_BET); + + port(Operator.class, DECIDE_BET).requires(Casino.class, PLAYER_WIN); + port(Casino.class, PLAYER_WIN).requires(Operator.class, DECIDE_BET); + port(Player.class, RECEIVE_MONEY).requires(Casino.class, PLAYER_WIN); + + port(Casino.class, CASINO_WIN).accepts(Operator.class, DECIDE_BET); + port(Casino.class, PLAYER_WIN).accepts(Operator.class, DECIDE_BET, Player.class, RECEIVE_MONEY); + port(Operator.class, DECIDE_BET).accepts(Casino.class, CASINO_WIN, Casino.class, PLAYER_WIN, Player.class, RECEIVE_MONEY); + port(Player.class, RECEIVE_MONEY).accepts(Casino.class, PLAYER_WIN, Operator.class, DECIDE_BET); + + data(Operator.class, OUTGOING_FUNDS).to(Casino.class, INCOMING_FUNDS); + data(Operator.class, ID).to(Casino.class, OPERATOR); + + data(Player.class, OUTGOING_BET).to(Casino.class, INCOMING_BET); + data(Player.class, OUTGOING_GUESS).to(Casino.class, INCOMING_GUESS); + data(Player.class, ID).to(Casino.class, PLAYER); + + data(Casino.class, OUTGOING_MONEY).to(Player.class, INCOMING_MONEY); + data(Casino.class, AVAILABLE_FUNDS).to(Operator.class, AVAILABLE_FUNDS); + } + }.build(); + + BIPEngine engine = engineFactory.create(ENGINE, glue); + + for (int id = 1; id <= 1; id++) { + int oid = 100 + id; + engine.register(new Operator(oid, 500), OPERATOR_SPEC + oid, true); + int cid = 200 + id; + engine.register(new Casino(cid,oid), CASINO_SPEC + cid, true); + } + + for (int id = 1; id <= 3; id++) { + int pid = 300 + id; + engine.register(new Player(pid, 100), PLAYER_SPEC + pid, true); + } + + engine.start(); + engine.execute(); + + while (true) { + // Run infinitely + } + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java new file mode 100644 index 00000000..c559350e --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java @@ -0,0 +1,91 @@ +package org.javabip.spec.casino; + +import org.javabip.annotations.*; +import org.javabip.api.DataOut; +import org.javabip.api.PortType; + +import static org.javabip.spec.casino.Constants.*; + + +@Ports({ + @Port(name = CREATE_GAME, type = PortType.enforceable), + @Port(name = ADD_TO_POT, type = PortType.enforceable), + @Port(name = REMOVE_FROM_POT, type = PortType.enforceable), + @Port(name = DECIDE_BET, type = PortType.enforceable), + @Port(name = PREPARE_TO_ADD, type = PortType.enforceable), + @Port(name = PREPARE_TO_REMOVE, type = PortType.enforceable), +}) + +@ComponentType(initial = WORKING, name = OPERATOR_SPEC) +@Invariant(expr = "pot >= 0") +@StatePredicate(state = IDLE, expr = "pot == 0") +public class Operator { + final Integer id; + int wallet; + int pot; + int amountToMove; + + Operator (Integer id, Integer funds) { + this.id = id; + wallet = funds; + amountToMove = 0; + System.out.println("OPERATOR" + id + " created with wallet: " + wallet); + } + + @Transitions({ + @Transition(name = CREATE_GAME, source = WORKING, target = WORKING), + @Transition(name = CREATE_GAME, source = PUT_FUNDS, target = PUT_FUNDS), + @Transition(name = CREATE_GAME, source = WITHDRAW_FUNDS, target = WITHDRAW_FUNDS), + @Transition(name = DECIDE_BET, source = WORKING, target = WORKING), + @Transition(name = DECIDE_BET, source = PUT_FUNDS, target = PUT_FUNDS), + @Transition(name = DECIDE_BET, source = WITHDRAW_FUNDS, target = WITHDRAW_FUNDS), + }) + public void gameStep(@Data(name = AVAILABLE_FUNDS) Integer pot) { + this.pot = pot; + System.out.println("OPERATOR" + id + ": making one step in the game"); + } + + @Transition(name = PREPARE_TO_ADD, source = WORKING, target = PUT_FUNDS, guard = ENOUGH_FUNDS) + public void prepareAmountToPut() { + amountToMove = (int) (Math.random() * wallet) + 1; + wallet -= amountToMove; + System.out.println("OPERATOR" + id + ": decided to put " + amountToMove + ", wallet: " + wallet); + } + + @Transition(name = PREPARE_TO_REMOVE, source = WORKING, target = WITHDRAW_FUNDS) + public void prepareAmountToWithdraw() { + amountToMove = (int) (Math.random() * pot) + 1; + System.out.println("OPERATOR" + id + ": decided to withdraw " + amountToMove + ", wallet: " + wallet); + } + + @Transition(name = ADD_TO_POT, source = PUT_FUNDS, target = WORKING) + public void addToPot (@Data(name = AVAILABLE_FUNDS) Integer pot) { + this.pot = pot + amountToMove; + System.out.println("OPERATOR" + id + ": added " + amountToMove + " to pot, wallet: " + wallet); + } + + @Transition(name = REMOVE_FROM_POT, source = WITHDRAW_FUNDS, target = WORKING) + public void removeFromPot (@Data(name = AVAILABLE_FUNDS) Integer pot) { + wallet += amountToMove; + this.pot = pot - amountToMove; + System.out.println("OPERATOR" + id + ": removed " + amountToMove + " from pot, wallet: " + wallet); + } + + @Pure + @Guard(name = ENOUGH_FUNDS) + public boolean haveMoney() { + return wallet > 0; + } + + @Pure + @Data(name = OUTGOING_FUNDS, accessTypePort = DataOut.AccessType.allowed, ports = {ADD_TO_POT, REMOVE_FROM_POT}) + public Integer funds() { + return amountToMove; + } + + @Pure + @Data(name = ID) + public Integer id() { + return id; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java new file mode 100644 index 00000000..2fa4b82d --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java @@ -0,0 +1,67 @@ +package org.javabip.spec.casino; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import static org.javabip.spec.casino.Coin.HEADS; +import static org.javabip.spec.casino.Coin.TAILS; +import static org.javabip.spec.casino.Constants.*; +@Ports({ + @Port(name = PREPARE_BET, type = PortType.enforceable), + @Port(name = PLACE_BET, type = PortType.enforceable), + @Port(name = RECEIVE_MONEY, type = PortType.enforceable), +}) + +@ComponentType(initial = GAME_AVAILABLE, name = PLAYER_SPEC) +@Invariant(expr = "bet <= purse") +public class Player { + final Integer id; + Integer bet; + Coin guess; + Integer purse; + + Player(Integer id, Integer purse) { + this.id = id; + this.purse = purse; + System.out.println("PLAYER" + id + ": INITIALIZED"); + } + + // Player places a bet + @Transition(name = PREPARE_BET, source = GAME_AVAILABLE, target = BET_PREPARED) + public void prepareBet() { + bet = (int)((Math.random() * purse)); + guess = (Math.random() < 0.5)? HEADS : TAILS; + purse = purse - bet; + System.out.println("PLAYER" + id + ": bet " + bet + " prepared, purse: " + purse); + } + + // Player places a bet + @Transition(name = PLACE_BET, source = BET_PREPARED, target = GAME_AVAILABLE) + public void placeBet() { + System.out.println("PLAYER" + id + ": bet " + bet + " placed, purse: " + purse); + bet = 0; + guess = null; + } + + // Player receives a contribution + @Transition(name = RECEIVE_MONEY, source = GAME_AVAILABLE, target = GAME_AVAILABLE) + public void receiveContribution(@Data(name = INCOMING_MONEY) Integer win) { + purse += win; + System.out.println("PLAYER" + id + ": won " + win + " purse: " + purse); + } + + @Data(name = OUTGOING_BET) + public Integer getBet() { + return bet; + } + + @Data(name = OUTGOING_GUESS) + public Coin getGuess() { + return guess; + } + + @Data(name = ID) + public Integer id() { + return id; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/CalculatorSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/CalculatorSpec.java new file mode 100644 index 00000000..9c0f70ab --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/CalculatorSpec.java @@ -0,0 +1,76 @@ +package org.javabip.spec.deviation; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import java.time.LocalDateTime; +import java.util.List; + +import static org.javabip.spec.deviation.Constants.*; + +@Ports({ + @Port(name = GET_DATA, type = PortType.enforceable), + @Port(name = SEND_DATA, type = PortType.enforceable), + @Port(name = START, type = PortType.enforceable), + @Port(name = RESET, type = PortType.enforceable) +}) + +@ComponentType(initial = INIT, name = CALCULATOR) +public class CalculatorSpec { + + private double mean; + private double variance; + + @Transition(name = START, source = INIT, target = WORK) + public void start() { + System.out.println("CALCULATOR: READY TO WORK"); + System.out.println("start" + LocalDateTime.now()); + } + + //@Transition(name = RESET, source = WORK, target = INIT) + public void reset() { + System.out.println("CALCULATOR: TERMINATE"); + } + + + @Transition(name = GET_DATA, source = WORK, target = CALCULATED, guard = "MEDIAN") + public void work(@Data(name = INCOMING_DATA)List data) { + System.out.println("CALCULATOR: CALCULATE DATA"); + //data.forEach(System.out::print); + //System.out.println(); + + mean = data.stream().mapToInt(a -> a).average().orElse(0); + variance = data.stream().mapToDouble(a -> Math.pow(a - mean, 2)).sum(); + + System.out.println("MEAN: " + mean); + System.out.println("VARIANCE: " + variance); + } + + + @Transition(name = SEND_DATA, source = CALCULATED, target = WORK) + public void send() throws InterruptedException { + System.out.println("CALCULATOR: DATA SENT"); + Thread.sleep(1000); + } + + @Data(name = OUTGOING_DATA_MEAN) + public double getMean() { + return mean; + } + + @Data(name = OUTGOING_DATA_VARIANCE) + public double getVariance() { + return variance; + } + + @Guard(name = "MEDIAN") + public boolean isSorted(@Data(name = INCOMING_DATA) List data){ + //System.out.println("Inside guard" + data); + //data.forEach(System.out::print); + //System.out.println(); + //Collections.sort(data); + //data.forEach(System.out::print); + //System.out.println("Go out of guard" + data); + return true; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Constants.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Constants.java new file mode 100644 index 00000000..57146f32 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Constants.java @@ -0,0 +1,37 @@ +package org.javabip.spec.deviation; + +public class Constants { + public static final String ENGINE = "engine"; + public static final String ACTOR_SYSTEM = "ActorSystem"; + public static final String GENERATOR_SPEC = "GeneratorSpec"; + public static final String DEVIATOR_SPEC = "DeviatorSpec"; + public static final String CALCULATOR_SPEC = "CalculatorSpec"; + public static final String DATA = "data"; + + public static final String GENERATOR = "generator"; + public static final String CALCULATOR = "calculator"; + public static final String DEVIATOR = "deviator"; + + public static final String GENERATE = "generate"; + public static final String GET_DATA = "getData"; + public static final String START = "start"; + public static final String RESET = "reset"; + public static final String SEND_DATA = "sendData"; + public static final String QUERY_DATA = "queryData"; + public static final String CALCULATE_STD = "calculateSTD"; + + public static final String INIT = "init"; + public static final String GENERATED = "generated"; + public static final String SENT = "sent"; + public static final String CALCULATED = "calculated"; + public static final String WORK = "working"; + public static final String RCV = "received"; + public static final String DONE = "done"; + + public static final String OUTGOING_DATA = "outgoingData"; + public static final String OUTGOING_DATA_MEAN = "outgoingDataMean"; + public static final String OUTGOING_DATA_VARIANCE = "outgoingDataVariance"; + public static final String INCOMING_DATA = "incomingData"; + public static final String INCOMING_DATA_MEAN = "incomingDataMean"; + public static final String INCOMING_DATA_VARIANCE = "incomingDataVariance"; +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/DeviatorSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/DeviatorSpec.java new file mode 100644 index 00000000..255f5ce1 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/DeviatorSpec.java @@ -0,0 +1,32 @@ +package org.javabip.spec.deviation; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import static org.javabip.spec.deviation.Constants.*; + +@Ports({ + @Port(name = QUERY_DATA, type = PortType.enforceable), + @Port(name = CALCULATE_STD, type = PortType.enforceable) +}) + +@ComponentType(initial = INIT, name = DEVIATOR) +public class DeviatorSpec { + private double mean; + private double variance; + private double std; + + @Transition(name = QUERY_DATA, source = INIT, target = RCV) + public void query(@Data(name = INCOMING_DATA_MEAN) double variance, @Data(name = INCOMING_DATA_VARIANCE) double mean) { + System.out.println("DEVIATOR: RECEIVED DATA"); + this.mean = mean; + this.variance = variance; + } + + @Transition(name = CALCULATE_STD, source = RCV, target = INIT) + public void deviate() { + std = Math.sqrt(variance); + System.out.println("STD: " + std); + System.out.println("DEVIATOR: TERMINATE"); + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/GeneratorSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/GeneratorSpec.java new file mode 100644 index 00000000..a6eb5a0d --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/GeneratorSpec.java @@ -0,0 +1,50 @@ +package org.javabip.spec.deviation; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; + +import static org.javabip.spec.deviation.Constants.*; + +@Ports({ + @Port(name = GENERATE, type = PortType.enforceable), + @Port(name = SEND_DATA, type = PortType.enforceable), + @Port(name = RESET, type = PortType.enforceable) +}) + +@ComponentType(initial = INIT, name = GENERATOR) +public class GeneratorSpec { + private List data = new ArrayList<>(); + //List data = Collections.synchronizedList(d); + private int min = 0; + private int max = 1000; + private int size = 100; + + @Transition(name = GENERATE, source = INIT, target = GENERATED) + public void generate() { + for (int i=0; i getData() { + return data; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Main.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Main.java new file mode 100644 index 00000000..3cec5bc9 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/deviation/Main.java @@ -0,0 +1,45 @@ +package org.javabip.spec.deviation; + +import akka.actor.ActorSystem; +import org.javabip.api.BIPEngine; +import org.javabip.api.BIPGlue; +import org.javabip.engine.factory.EngineFactory; +import org.javabip.glue.TwoSynchronGlueBuilder; + +import static org.javabip.spec.deviation.Constants.*; + +public class Main { + public static void main(String[] args) throws Exception { + ActorSystem system = ActorSystem.create(ACTOR_SYSTEM); + EngineFactory engineFactory = new EngineFactory(system); + + BIPGlue glue = new TwoSynchronGlueBuilder() { + @Override + public void configure() { + synchron(GeneratorSpec.class, SEND_DATA).to(CalculatorSpec.class, GET_DATA); + synchron(CalculatorSpec.class, SEND_DATA).to(DeviatorSpec.class, QUERY_DATA); + data(GeneratorSpec.class, OUTGOING_DATA).to(CalculatorSpec.class, INCOMING_DATA); + data(CalculatorSpec.class, OUTGOING_DATA_MEAN).to(DeviatorSpec.class, INCOMING_DATA_MEAN); + data(CalculatorSpec.class, OUTGOING_DATA_VARIANCE).to(DeviatorSpec.class, INCOMING_DATA_VARIANCE); + } + }.build(); + + BIPEngine engine = engineFactory.create(ENGINE, glue); + engine.register(new GeneratorSpec(), GENERATOR_SPEC, true); + engine.register(new DeviatorSpec(), DEVIATOR_SPEC, true); + engine.register(new CalculatorSpec(), CALCULATOR_SPEC, true); + + engine.start(); + engine.execute(); + + //Thread.sleep(50000); + while(true){ + Thread.sleep(60000); + //System.out.println("ping"); + } + + //engine.stop(); + //engineFactory.destroy(engine); + //system.shutdown(); + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Constants.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Constants.java new file mode 100644 index 00000000..59992e94 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Constants.java @@ -0,0 +1,22 @@ +package org.javabip.spec.ping; + +public class Constants { + public static final String ENGINE = "engine"; + public static final String ACTOR_SYSTEM = "ActorSystem"; + public static final String PING_USER_SPEC = "PingUserSpec"; + public static final String PING_CMD_SPEC = "PingCmdSpec"; + + public static final String PING = "ping"; + public static final String PONG = "pong"; + public static final String BACK = "back"; + + public static final String INIT = "init"; + public static final String DO = "do"; + public static final String FAIL = "fail"; + + public static final String COUNT = "count"; + public static final String OUTGOING_TIME = "outgoingTime"; + public static final String INCOMING_TIME = "incomingTime"; + + public static final String CHECK_TIME = "checkTimeBad"; +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Main.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Main.java new file mode 100644 index 00000000..13bbef48 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/Main.java @@ -0,0 +1,38 @@ +package org.javabip.spec.ping; + +import akka.actor.ActorSystem; +import org.javabip.api.BIPEngine; +import org.javabip.api.BIPGlue; +import org.javabip.engine.factory.EngineFactory; +import org.javabip.glue.TwoSynchronGlueBuilder; + +import static org.javabip.spec.ping.Constants.*; + +public class Main { + public static void main(String[] args) throws Exception { + ActorSystem system = ActorSystem.create(ACTOR_SYSTEM); + EngineFactory engineFactory = new EngineFactory(system); + + BIPGlue glue = new TwoSynchronGlueBuilder() { + @Override + public void configure() { + synchron(PingUserSpec.class, PING).to(PingCmdSpec.class, PING); + synchron(PingUserSpec.class, PING).to(PingCmdSpec.class, PONG); + data(PingUserSpec.class, OUTGOING_TIME).to(PingCmdSpec.class, INCOMING_TIME); + } + }.build(); + + BIPEngine engine = engineFactory.create(ENGINE, glue); + engine.register(new PingUserSpec(), PING_USER_SPEC, true); + engine.register(new PingCmdSpec(), PING_CMD_SPEC, true); + + engine.start(); + engine.execute(); + + Thread.sleep(10000); + + engine.stop(); + engineFactory.destroy(engine); + system.shutdown(); + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingCmdSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingCmdSpec.java new file mode 100644 index 00000000..68603456 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingCmdSpec.java @@ -0,0 +1,38 @@ +package org.javabip.spec.ping; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import static org.javabip.spec.deviation.Constants.INIT; +import static org.javabip.spec.ping.Constants.*; + +@Ports({ + @Port(name = PING, type = PortType.enforceable), + @Port(name = PONG, type = PortType.enforceable), + @Port(name = BACK, type = PortType.enforceable) +}) + +@ComponentType(initial = INIT, name = PING_CMD_SPEC) +public class PingCmdSpec { + @Transition(name = PING, source = INIT, target = DO) //, guard = CHECK_TIME) + public void receivedTime(@Data(name = INCOMING_TIME) Integer time) throws InterruptedException { + Thread.sleep(time); + System.out.println("CMD: COMMAND RECEIVED"); + } + + @Transition(name = BACK, source = DO, target = INIT) + public void goBack() { + System.out.println("CMD: RESET"); + } + + @Transition(name = PONG, source = INIT, target = FAIL, guard = "!"+CHECK_TIME) + public void receiveBadTime() { + System.out.println("CMD: ERROR: TIME VALUE EXCEEDS THE LIMIT"); + System.exit(1); + } + + @Guard(name = CHECK_TIME) + public boolean checkTime(@Data(name = INCOMING_TIME) Integer time) { + return time < 1000; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingUserSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingUserSpec.java new file mode 100644 index 00000000..f2eac6fe --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ping/PingUserSpec.java @@ -0,0 +1,25 @@ +package org.javabip.spec.ping; + +import org.javabip.annotations.*; +import org.javabip.api.PortType; + +import static org.javabip.spec.ping.Constants.*; + +@Ports({ + @Port(name = PING, type = PortType.enforceable) +}) + +@ComponentType(initial = INIT, name = PING_USER_SPEC) +public class PingUserSpec { + Integer time = 10000; + @Transition(name = PING, source = INIT, target = INIT) + public void ping() throws InterruptedException { + System.out.println("USER: PING -i 1"); + Thread.sleep(1000); + } + + @Data(name = OUTGOING_TIME) + public Integer getTime() { + return time; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/Constants.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/Constants.java new file mode 100644 index 00000000..34472c74 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/Constants.java @@ -0,0 +1,67 @@ +package org.javabip.spec.ringelection; + +public class Constants { + + //transitions (algorithm related) + public static final String GT = "GT"; + public static final String LT = "LT"; + public static final String EQ = "EQ"; + public static final String ELECTED = "ELECTED"; + public static final String NOT_ELECTED = "!ELECTED"; + + //states + public static final String ACTIVE = "active"; + public static final String PASSIVE = "passive"; + public static final String LEADER = "leader"; + public static final String FOLLOWER = "follower"; + + //spec name + public static final String PROCESS = "Process"; + public static final String LOGGER = "Logger"; + + //actor system + public static final String RING_ACTOR_SYSTEM = "RingActorSystem"; + public static final String PROCESS_SPEC = "ProcessSpec"; + public static final String LOGGER_SPEC = "LoggerSpec"; + + + //transitions (communication related) + public static final String SEND = "send"; + public static final String SEND_DONE = "sendDone"; + public static final String RECEIVE = "receive"; + + //transitions (communication related) + public static final String SEND_OWN = "sendOwn"; + public static final String SEND_LEADER = "sendLeader"; + public static final String SEND_OTHER = "sendOther"; + public static final String RECEIVE_OWN = "receiveOwn"; + public static final String RECEIVE_LEADER = "receiveLeader"; + public static final String RECEIVE_BIG = "receiveBig"; + public static final String RECEIVE_SMALL = "receiveSmall"; + + public static final String LOG = "log"; + + // guards + public static final String CHECK_SENDER = "checkSender"; + public static final String GD_RECEIVED_LEADER = "receivedLeader"; + public static final String GD_RECEIVED_SMALL = "receivedSmall"; + public static final String GD_RECEIVED_BIG = "receivedBig"; + public static final String GD_RECEIVED_OWN = "receivedOwn"; + public static final String GD_ELECTED = "guardElected"; + public static final String GD_NOT_ELECTED = "!guardElected"; + + //states (communication related) + public static final String SENT = "sent"; + public static final String RECEIVED = "received"; + public static final String INITIAL = "initial"; + public static final String DONE = "done"; + + //data agnostic + public static final String OUTGOING_PROCESS_HEADER = "outgoingHeader"; + public static final String INCOMING_PROCESS_HEADER = "incomingHeader"; + public static final String OUTGOING_PROCESS_DATA = "outgoingData"; + public static final String INCOMING_PROCESS_DATA = "incomingData"; + + //constants + public static final String ENGINE = "engine"; +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessMessage.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessMessage.java new file mode 100644 index 00000000..5fd4645a --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessMessage.java @@ -0,0 +1,21 @@ +package org.javabip.spec.ringelection; + +public class ProcessMessage { + MessageType messageType; + int round; + int processID; + + public ProcessMessage(MessageType messageType, int round, int processID) { + this.messageType = messageType; + this.round = round; + this.processID = processID; + } + + enum MessageType { + ELECTION, LEADER; + } + + public ProcessMessage copy(){ + return new ProcessMessage(messageType, round, processID); + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java new file mode 100644 index 00000000..0e84f9e6 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java @@ -0,0 +1,163 @@ +package org.javabip.spec.ringelection; + +import org.javabip.annotations.*; +import org.javabip.annotations.Port; +import org.javabip.api.PortType; +import org.javabip.annotations.Data; + +import static org.javabip.spec.ringelection.Constants.*; + +@Ports({ + @Port(name = SEND, type = PortType.enforceable), + @Port(name = SEND_DONE, type = PortType.enforceable), + @Port(name = RECEIVE, type = PortType.enforceable) +}) + +@ComponentType(initial = INITIAL, name = PROCESS) +@Invariant(expr = "isLeader == false || processID == 0") +public class ProcessSpec { + private int processID; + private boolean isActive; + private boolean isLeader; + private boolean isInitiator; + private boolean isElected = false; + private ProcessSpec leftNeighbour; + private ProcessSpec rightNeighbour; + private int round = 0; + + ProcessMessage processMessage; + + public ProcessSpec(int processID, boolean isActive, boolean isInitiator) { + this.processID = processID; + this.isActive = isActive; + this.isInitiator = isInitiator; + this.isLeader = false; + processMessage = new ProcessMessage(ProcessMessage.MessageType.ELECTION, round, processID); + } + + + @Transitions({ + @Transition(name = SEND, source = INITIAL, target = SENT, pre = "isLeader == true", post = "isActive == false"), + @Transition(name = SEND, source = RECEIVED, target = SENT, guard = GD_NOT_ELECTED), + @Transition(name = SEND_DONE, source = RECEIVED, target = DONE, guard = GD_ELECTED) + }) + public void send() { + System.out.println("Process " + processID + " has sent #" + processMessage.processID); + } + + @Transitions({ + @Transition(name = RECEIVE, source = SENT, target = RECEIVED, guard = CHECK_SENDER), + @Transition(name = RECEIVE, source = INITIAL, target = RECEIVED, guard = CHECK_SENDER), + @Transition(name = RECEIVE, source = DONE, target = DONE, guard = CHECK_SENDER) + }) + public void receive(@Data(name = INCOMING_PROCESS_DATA) ProcessMessage processMessage, @Data(name = INCOMING_PROCESS_HEADER) int header) { + System.out.println("Process " + processID + " has received #" + processMessage.processID); + compute(processMessage); + } + + //@Transition(name = COMPUTE, source = RECEIVED, target = DONE) + public void compute(ProcessMessage processMessage) { + + if (!isElected) { + //check if this is a notification message of elected leader + if (processMessage.messageType.equals(ProcessMessage.MessageType.LEADER)) { + this.processMessage = processMessage; + this.isElected = true; + } + + // if the process is in active state, compare its id with the incoming id + if (this.isActive) { + int leftProcessID = processMessage.processID; + + //if the incoming id is smaller, dismiss it and send own id to the next neighbour + if (leftProcessID < this.processID) { + processMessage.round++; + //this.processMessage = new ProcessMessage(ProcessMessage.MessageType.ELECTION, round++, this.processID); + } + + //if the incoming id is bigger, this process becomes passive and translates incoming id to the next neighbour + else if (leftProcessID > this.processID) { + this.isActive = false; + this.processMessage = processMessage; + System.out.println("Process " + processID + " is now passive"); + } + + //if the incoming id is equal to this.id, this process becomes the leader + else { + this.isLeader = true; + this.isElected = true; + this.processMessage = new ProcessMessage(ProcessMessage.MessageType.LEADER, round++, this.processID); + System.out.println("Process " + processID + ": I am the leader!"); + } + } + + //otherwise, if the process is already passive, just pass the message further + else { + this.processMessage = processMessage; + System.out.println("Process " + processID + ": Passing the highest id (" + processMessage.processID + ")"); + } + } + + } + + public boolean isInitiator() { + return isInitiator; + } + + @Guard(name = GD_ELECTED) + public boolean isElected() { + return isElected; + } + + public int getRound() { + return round; + } + + private boolean areNeighboursSet() { + return leftNeighbour != null && rightNeighbour != null; + } + + public boolean isActive() { + return isActive; + } + + public boolean isLeader() { + return isLeader; + } + + public void setLeftNeighbour(ProcessSpec leftNeighbour) { + this.leftNeighbour = leftNeighbour; + } + + public void setRightNeighbour(ProcessSpec rightNeighbour) { + this.rightNeighbour = rightNeighbour; + } + + @Data(name = OUTGOING_PROCESS_HEADER) + public int getProcessID() { + return processID; + } + + @Data(name = OUTGOING_PROCESS_DATA) + public ProcessMessage getProcessMessage() throws InterruptedException { + return processMessage; + } + + @Guard(name = CHECK_SENDER) + public boolean checkSender(@Data(name = INCOMING_PROCESS_HEADER) int header) { + return header == leftNeighbour.processID; + } + + @Override + public String toString() { + return "\nProcess{" + + "processID=" + processID + + //", isActive=" + isActive + + ", isLeader=" + isLeader + + //", isInitiator=" + isInitiator + + ", isElected=" + isElected + + ", leftNeighbour=" + (leftNeighbour == null ? "null" : leftNeighbour.processID) + + ", rightNeighbour=" + (rightNeighbour == null ? "null" : rightNeighbour.processID) + + "}"; + } +} diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/RingBIP.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/RingBIP.java new file mode 100644 index 00000000..a90c8be9 --- /dev/null +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/RingBIP.java @@ -0,0 +1,113 @@ +package org.javabip.spec.ringelection; + +import akka.actor.ActorSystem; +import org.javabip.api.BIPEngine; +import org.javabip.api.BIPGlue; +import org.javabip.engine.factory.EngineFactory; +import org.javabip.glue.TwoSynchronGlueBuilder; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Objects; + +import static org.javabip.spec.ringelection.Constants.*; + +public class RingBIP { + private ArrayList processesList = new ArrayList<>(); + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RingBIP ring = (RingBIP) o; + return processesList.equals(ring.processesList); + } + + @Override + public int hashCode() { + return Objects.hash(processesList); + } + + public RingBIP(int size, BIPEngine engine) throws Exception { + + //generate a list of processes of a given size where each process is initiator + for (int id = 0; id < size; id++) { + ProcessSpec processSpec = new ProcessSpec(id, true, true); + processesList.add(processSpec); + engine.register(processSpec, PROCESS_SPEC + id, true); + } + + //randomize the order + Collections.shuffle(processesList); + + //connect processes together in both directions + int processListSize = processesList.size(); + + for (int i = 1; i< processListSize; i++){ + ProcessSpec left = processesList.get(i - 1); + ProcessSpec right = processesList.get(i); + + left.setRightNeighbour(right); + right.setLeftNeighbour(left); + } + + ProcessSpec first = processesList.get(0); + ProcessSpec last = processesList.get(processListSize - 1); + + first.setLeftNeighbour(last); + last.setRightNeighbour(first); + } + + public ArrayList getProcessesList() { + return processesList; + } + + public static void main(String[] args) throws Exception { + ActorSystem system = ActorSystem.create(RING_ACTOR_SYSTEM); + EngineFactory engineFactory = new EngineFactory(system); + + BIPGlue glue = new TwoSynchronGlueBuilder() { + @Override + public void configure() { + synchron(ProcessSpec.class, SEND).to(ProcessSpec.class, RECEIVE); + synchron(ProcessSpec.class, SEND_DONE).to(ProcessSpec.class, RECEIVE); + data(ProcessSpec.class, OUTGOING_PROCESS_HEADER).to(ProcessSpec.class, INCOMING_PROCESS_HEADER); + data(ProcessSpec.class, OUTGOING_PROCESS_DATA).to(ProcessSpec.class, INCOMING_PROCESS_DATA); + } + }.build(); + + BIPEngine engine = engineFactory.create(ENGINE, glue); + + RingBIP ring = new RingBIP(10, engine); + + engine.start(); + engine.execute(); + + + while (true){ + Thread.sleep(5000); + System.out.println(ring); + System.out.println(Arrays.toString(ring.processesList.stream().map(ProcessSpec::getRound).toArray())); + } + + /* + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + engine.stop(); + engineFactory.destroy(engine); + system.shutdown(); + System.out.println(ring);*/ + } + + + @Override + public String toString() { + return "Ring{" + + "processesList=" + processesList + + '}'; + } +} \ No newline at end of file From eec0e962be8cf713760335888917fa05365e2f95 Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 17:49:10 +0200 Subject: [PATCH 14/19] little cleaning 1) rename BIPCoordinator to GlueCoordinator, 2) add BIPException check in DataCoordinationKernel for register method, GlueCoordinatorImpl run and start methods 3) add informInternal, informSpontaneous methods skeletons --- org.javabip.api/pom.xml | 23 ++++++++++++++++--- .../main/java/org/javabip/api/BIPEngine.java | 18 ++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/org.javabip.api/pom.xml b/org.javabip.api/pom.xml index 5dbba290..f92a6ce5 100644 --- a/org.javabip.api/pom.xml +++ b/org.javabip.api/pom.xml @@ -1,8 +1,25 @@ 4.0.0 + + + org.openjfx + javafx-base + 17-ea+11 + + + org.antlr + antlr4-runtime + 4.8-1 + compile + + + junit + junit + + - + org.javabip org.javabip.parent 0.1.0-SNAPSHOT @@ -51,8 +68,8 @@ org.apache.maven.plugins maven-compiler-plugin - 7 - 7 + 8 + 8 diff --git a/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java b/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java index 475c843d..825765ea 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java +++ b/org.javabip.api/src/main/java/org/javabip/api/BIPEngine.java @@ -80,10 +80,26 @@ public interface BIPEngine { void informSpecific(BIPComponent decidingComponent, Port decidingPort, Map> disabledCombinations); + /** + * informInternal is served for notifying the engine on the internal transition happened on the component + * needed for the monitoring + * @param decidingComponent + * @param currentState + */ + void informInteral(BIPComponent decidingComponent, String currentState); + + /** + * informSpontaneous is served for notifying the engine on the spontaneous transition happened on the component + * needed for the monitoring + * @param decidingComponent + * @param currentState + */ + void informSpontaneous(BIPComponent decidingComponent, String currentState); + /** * It starts the BIP engine thread. */ - void start() throws Exception; + void start(); /** * It stops the BIP engine thread. From b7346be58ee76ae6b96ef32d15686a9ba9823233 Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 17:51:24 +0200 Subject: [PATCH 15/19] Java Expression parsing, building AST, visitors for evaluating expression --- .../verification/parser/JavaLexer.interp | 408 ++++++++++++ .../verification/parser/JavaLexer.java | 581 ++++++++++++++++++ .../verification/parser/JavaLexer.tokens | 242 ++++++++ .../verification/parser/JavaParser.interp | 275 +++++++++ .../verification/parser/JavaParser.tokens | 242 ++++++++ .../parser/JavaParserBaseListener.java | 135 ++++ .../parser/JavaParserBaseVisitor.java | 70 +++ .../parser/JavaParserListener.java | 90 +++ .../parser/JavaParserVisitor.java | 61 ++ .../verification/ast/BitBinaryExpression.java | 8 - .../verification/ast/BooleanExpression.java | 7 - .../ast/DotSeparatedExpression.java | 24 +- .../verification/ast/EqualityExpression.java | 7 - .../verification/ast/FloatExpression.java | 12 - .../ast/IdentifierExpression.java | 33 +- .../verification/ast/IntegerExpression.java | 12 - .../verification/ast/LogicalExpression.java | 6 - .../ast/MethodCallExpression.java | 7 - .../ast/MethodIdentifierExpression.java | 33 + .../verification/ast/NullExpression.java | 7 - .../ast/ParsedJavaExpression.java | 2 - .../verification/ast/PostfixExpression.java | 17 - .../verification/ast/PrefixExpression.java | 15 - .../verification/ast/ProductExpression.java | 6 - .../ast/RelationalExpression.java | 45 +- .../verification/ast/StringExpression.java | 6 - .../verification/ast/SumExpression.java | 7 - .../verification/ast/SuperExpression.java | 15 - .../verification/ast/TernaryExpression.java | 15 - .../verification/ast/ThisExpression.java | 7 - .../visitors/ExpressionASTBuilder.java | 88 ++- .../visitors/PJEEvaluateNumericVisitor.java | 70 --- .../visitors/test/FakeSpecification.java | 62 ++ .../test/PJEEvaluateNumericVisitorTest.java | 167 ----- .../visitors/test/PJEEvaluateVisitorTest.java | 82 +-- .../ParsedJavaExpressionASTBuilderTest.java | 27 +- 36 files changed, 2342 insertions(+), 549 deletions(-) create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java create mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/ast/MethodIdentifierExpression.java delete mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java create mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/test/FakeSpecification.java delete mode 100644 org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp new file mode 100644 index 00000000..18e0f528 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp @@ -0,0 +1,408 @@ +token literal names: +null +'abstract' +'assert' +'boolean' +'break' +'byte' +'case' +'catch' +'char' +'class' +'const' +'continue' +'default' +'do' +'double' +'else' +'enum' +'extends' +'final' +'finally' +'float' +'for' +'if' +'goto' +'implements' +'import' +'instanceof' +'int' +'interface' +'long' +'native' +'new' +'package' +'private' +'protected' +'public' +'return' +'short' +'static' +'strictfp' +'super' +'switch' +'synchronized' +'this' +'throw' +'throws' +'transient' +'try' +'void' +'volatile' +'while' +'module' +'open' +'requires' +'exports' +'opens' +'to' +'uses' +'provides' +'with' +'transitive' +'var' +'yield' +'record' +'sealed' +'permits' +'non-sealed' +null +null +null +null +null +null +null +null +null +null +'null' +'(' +')' +'{' +'}' +'[' +']' +';' +',' +'.' +'=' +'>' +'<' +'!' +'~' +'?' +':' +'==' +'<=' +'>=' +'!=' +'&&' +'||' +'++' +'--' +'+' +'-' +'*' +'/' +'&' +'|' +'^' +'%' +'+=' +'-=' +'*=' +'/=' +'&=' +'|=' +'^=' +'%=' +'<<=' +'>>=' +'>>>=' +'->' +'::' +'@' +'...' +null +null +null +null + +token symbolic names: +null +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER + +rule names: +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER +ExponentPart +EscapeSequence +HexDigits +HexDigit +Digits +LetterOrDigit +Letter + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 130, 1114, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 4, 120, 9, 120, 4, 121, 9, 121, 4, 122, 9, 122, 4, 123, 9, 123, 4, 124, 9, 124, 4, 125, 9, 125, 4, 126, 9, 126, 4, 127, 9, 127, 4, 128, 9, 128, 4, 129, 9, 129, 4, 130, 9, 130, 4, 131, 9, 131, 4, 132, 9, 132, 4, 133, 9, 133, 4, 134, 9, 134, 4, 135, 9, 135, 4, 136, 9, 136, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 5, 68, 727, 10, 68, 3, 68, 6, 68, 730, 10, 68, 13, 68, 14, 68, 731, 3, 68, 5, 68, 735, 10, 68, 5, 68, 737, 10, 68, 3, 68, 5, 68, 740, 10, 68, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 746, 10, 69, 12, 69, 14, 69, 749, 11, 69, 3, 69, 5, 69, 752, 10, 69, 3, 69, 5, 69, 755, 10, 69, 3, 70, 3, 70, 7, 70, 759, 10, 70, 12, 70, 14, 70, 762, 11, 70, 3, 70, 3, 70, 7, 70, 766, 10, 70, 12, 70, 14, 70, 769, 11, 70, 3, 70, 5, 70, 772, 10, 70, 3, 70, 5, 70, 775, 10, 70, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 781, 10, 71, 12, 71, 14, 71, 784, 11, 71, 3, 71, 5, 71, 787, 10, 71, 3, 71, 5, 71, 790, 10, 71, 3, 72, 3, 72, 3, 72, 5, 72, 795, 10, 72, 3, 72, 3, 72, 5, 72, 799, 10, 72, 3, 72, 5, 72, 802, 10, 72, 3, 72, 5, 72, 805, 10, 72, 3, 72, 3, 72, 3, 72, 5, 72, 810, 10, 72, 3, 72, 5, 72, 813, 10, 72, 5, 72, 815, 10, 72, 3, 73, 3, 73, 3, 73, 3, 73, 5, 73, 821, 10, 73, 3, 73, 5, 73, 824, 10, 73, 3, 73, 3, 73, 5, 73, 828, 10, 73, 3, 73, 3, 73, 5, 73, 832, 10, 73, 3, 73, 3, 73, 5, 73, 836, 10, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 847, 10, 74, 3, 75, 3, 75, 3, 75, 5, 75, 852, 10, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 7, 76, 859, 10, 76, 12, 76, 14, 76, 862, 11, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 871, 10, 77, 12, 77, 14, 77, 874, 11, 77, 3, 77, 3, 77, 3, 77, 7, 77, 879, 10, 77, 12, 77, 14, 77, 882, 11, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 3, 93, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 104, 3, 104, 3, 105, 3, 105, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 113, 3, 113, 3, 113, 3, 114, 3, 114, 3, 114, 3, 115, 3, 115, 3, 115, 3, 116, 3, 116, 3, 116, 3, 117, 3, 117, 3, 117, 3, 118, 3, 118, 3, 118, 3, 119, 3, 119, 3, 119, 3, 119, 3, 120, 3, 120, 3, 120, 3, 120, 3, 121, 3, 121, 3, 121, 3, 121, 3, 121, 3, 122, 3, 122, 3, 122, 3, 123, 3, 123, 3, 123, 3, 124, 3, 124, 3, 125, 3, 125, 3, 125, 3, 125, 3, 126, 6, 126, 1015, 10, 126, 13, 126, 14, 126, 1016, 3, 126, 3, 126, 3, 127, 3, 127, 3, 127, 3, 127, 7, 127, 1025, 10, 127, 12, 127, 14, 127, 1028, 11, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 128, 3, 128, 3, 128, 3, 128, 7, 128, 1039, 10, 128, 12, 128, 14, 128, 1042, 11, 128, 3, 128, 3, 128, 3, 129, 3, 129, 7, 129, 1048, 10, 129, 12, 129, 14, 129, 1051, 11, 129, 3, 130, 3, 130, 5, 130, 1055, 10, 130, 3, 130, 3, 130, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1063, 10, 131, 3, 131, 5, 131, 1066, 10, 131, 3, 131, 3, 131, 3, 131, 6, 131, 1071, 10, 131, 13, 131, 14, 131, 1072, 3, 131, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1080, 10, 131, 3, 132, 3, 132, 3, 132, 7, 132, 1085, 10, 132, 12, 132, 14, 132, 1088, 11, 132, 3, 132, 5, 132, 1091, 10, 132, 3, 133, 3, 133, 3, 134, 3, 134, 7, 134, 1097, 10, 134, 12, 134, 14, 134, 1100, 11, 134, 3, 134, 5, 134, 1103, 10, 134, 3, 135, 3, 135, 5, 135, 1107, 10, 135, 3, 136, 3, 136, 3, 136, 3, 136, 5, 136, 1113, 10, 136, 4, 880, 1026, 2, 137, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 75, 149, 76, 151, 77, 153, 78, 155, 79, 157, 80, 159, 81, 161, 82, 163, 83, 165, 84, 167, 85, 169, 86, 171, 87, 173, 88, 175, 89, 177, 90, 179, 91, 181, 92, 183, 93, 185, 94, 187, 95, 189, 96, 191, 97, 193, 98, 195, 99, 197, 100, 199, 101, 201, 102, 203, 103, 205, 104, 207, 105, 209, 106, 211, 107, 213, 108, 215, 109, 217, 110, 219, 111, 221, 112, 223, 113, 225, 114, 227, 115, 229, 116, 231, 117, 233, 118, 235, 119, 237, 120, 239, 121, 241, 122, 243, 123, 245, 124, 247, 125, 249, 126, 251, 127, 253, 128, 255, 129, 257, 130, 259, 2, 261, 2, 263, 2, 265, 2, 267, 2, 269, 2, 271, 2, 3, 2, 29, 3, 2, 51, 59, 4, 2, 78, 78, 110, 110, 4, 2, 90, 90, 122, 122, 5, 2, 50, 59, 67, 72, 99, 104, 6, 2, 50, 59, 67, 72, 97, 97, 99, 104, 3, 2, 50, 57, 4, 2, 50, 57, 97, 97, 4, 2, 68, 68, 100, 100, 3, 2, 50, 51, 4, 2, 50, 51, 97, 97, 6, 2, 70, 70, 72, 72, 102, 102, 104, 104, 4, 2, 82, 82, 114, 114, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 11, 11, 34, 34, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 71, 71, 103, 103, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97, 99, 124, 4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345, 2, 1158, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 2, 165, 3, 2, 2, 2, 2, 167, 3, 2, 2, 2, 2, 169, 3, 2, 2, 2, 2, 171, 3, 2, 2, 2, 2, 173, 3, 2, 2, 2, 2, 175, 3, 2, 2, 2, 2, 177, 3, 2, 2, 2, 2, 179, 3, 2, 2, 2, 2, 181, 3, 2, 2, 2, 2, 183, 3, 2, 2, 2, 2, 185, 3, 2, 2, 2, 2, 187, 3, 2, 2, 2, 2, 189, 3, 2, 2, 2, 2, 191, 3, 2, 2, 2, 2, 193, 3, 2, 2, 2, 2, 195, 3, 2, 2, 2, 2, 197, 3, 2, 2, 2, 2, 199, 3, 2, 2, 2, 2, 201, 3, 2, 2, 2, 2, 203, 3, 2, 2, 2, 2, 205, 3, 2, 2, 2, 2, 207, 3, 2, 2, 2, 2, 209, 3, 2, 2, 2, 2, 211, 3, 2, 2, 2, 2, 213, 3, 2, 2, 2, 2, 215, 3, 2, 2, 2, 2, 217, 3, 2, 2, 2, 2, 219, 3, 2, 2, 2, 2, 221, 3, 2, 2, 2, 2, 223, 3, 2, 2, 2, 2, 225, 3, 2, 2, 2, 2, 227, 3, 2, 2, 2, 2, 229, 3, 2, 2, 2, 2, 231, 3, 2, 2, 2, 2, 233, 3, 2, 2, 2, 2, 235, 3, 2, 2, 2, 2, 237, 3, 2, 2, 2, 2, 239, 3, 2, 2, 2, 2, 241, 3, 2, 2, 2, 2, 243, 3, 2, 2, 2, 2, 245, 3, 2, 2, 2, 2, 247, 3, 2, 2, 2, 2, 249, 3, 2, 2, 2, 2, 251, 3, 2, 2, 2, 2, 253, 3, 2, 2, 2, 2, 255, 3, 2, 2, 2, 2, 257, 3, 2, 2, 2, 3, 273, 3, 2, 2, 2, 5, 282, 3, 2, 2, 2, 7, 289, 3, 2, 2, 2, 9, 297, 3, 2, 2, 2, 11, 303, 3, 2, 2, 2, 13, 308, 3, 2, 2, 2, 15, 313, 3, 2, 2, 2, 17, 319, 3, 2, 2, 2, 19, 324, 3, 2, 2, 2, 21, 330, 3, 2, 2, 2, 23, 336, 3, 2, 2, 2, 25, 345, 3, 2, 2, 2, 27, 353, 3, 2, 2, 2, 29, 356, 3, 2, 2, 2, 31, 363, 3, 2, 2, 2, 33, 368, 3, 2, 2, 2, 35, 373, 3, 2, 2, 2, 37, 381, 3, 2, 2, 2, 39, 387, 3, 2, 2, 2, 41, 395, 3, 2, 2, 2, 43, 401, 3, 2, 2, 2, 45, 405, 3, 2, 2, 2, 47, 408, 3, 2, 2, 2, 49, 413, 3, 2, 2, 2, 51, 424, 3, 2, 2, 2, 53, 431, 3, 2, 2, 2, 55, 442, 3, 2, 2, 2, 57, 446, 3, 2, 2, 2, 59, 456, 3, 2, 2, 2, 61, 461, 3, 2, 2, 2, 63, 468, 3, 2, 2, 2, 65, 472, 3, 2, 2, 2, 67, 480, 3, 2, 2, 2, 69, 488, 3, 2, 2, 2, 71, 498, 3, 2, 2, 2, 73, 505, 3, 2, 2, 2, 75, 512, 3, 2, 2, 2, 77, 518, 3, 2, 2, 2, 79, 525, 3, 2, 2, 2, 81, 534, 3, 2, 2, 2, 83, 540, 3, 2, 2, 2, 85, 547, 3, 2, 2, 2, 87, 560, 3, 2, 2, 2, 89, 565, 3, 2, 2, 2, 91, 571, 3, 2, 2, 2, 93, 578, 3, 2, 2, 2, 95, 588, 3, 2, 2, 2, 97, 592, 3, 2, 2, 2, 99, 597, 3, 2, 2, 2, 101, 606, 3, 2, 2, 2, 103, 612, 3, 2, 2, 2, 105, 619, 3, 2, 2, 2, 107, 624, 3, 2, 2, 2, 109, 633, 3, 2, 2, 2, 111, 641, 3, 2, 2, 2, 113, 647, 3, 2, 2, 2, 115, 650, 3, 2, 2, 2, 117, 655, 3, 2, 2, 2, 119, 664, 3, 2, 2, 2, 121, 669, 3, 2, 2, 2, 123, 680, 3, 2, 2, 2, 125, 684, 3, 2, 2, 2, 127, 690, 3, 2, 2, 2, 129, 697, 3, 2, 2, 2, 131, 704, 3, 2, 2, 2, 133, 712, 3, 2, 2, 2, 135, 736, 3, 2, 2, 2, 137, 741, 3, 2, 2, 2, 139, 756, 3, 2, 2, 2, 141, 776, 3, 2, 2, 2, 143, 814, 3, 2, 2, 2, 145, 816, 3, 2, 2, 2, 147, 846, 3, 2, 2, 2, 149, 848, 3, 2, 2, 2, 151, 855, 3, 2, 2, 2, 153, 865, 3, 2, 2, 2, 155, 887, 3, 2, 2, 2, 157, 892, 3, 2, 2, 2, 159, 894, 3, 2, 2, 2, 161, 896, 3, 2, 2, 2, 163, 898, 3, 2, 2, 2, 165, 900, 3, 2, 2, 2, 167, 902, 3, 2, 2, 2, 169, 904, 3, 2, 2, 2, 171, 906, 3, 2, 2, 2, 173, 908, 3, 2, 2, 2, 175, 910, 3, 2, 2, 2, 177, 912, 3, 2, 2, 2, 179, 914, 3, 2, 2, 2, 181, 916, 3, 2, 2, 2, 183, 918, 3, 2, 2, 2, 185, 920, 3, 2, 2, 2, 187, 922, 3, 2, 2, 2, 189, 924, 3, 2, 2, 2, 191, 927, 3, 2, 2, 2, 193, 930, 3, 2, 2, 2, 195, 933, 3, 2, 2, 2, 197, 936, 3, 2, 2, 2, 199, 939, 3, 2, 2, 2, 201, 942, 3, 2, 2, 2, 203, 945, 3, 2, 2, 2, 205, 948, 3, 2, 2, 2, 207, 950, 3, 2, 2, 2, 209, 952, 3, 2, 2, 2, 211, 954, 3, 2, 2, 2, 213, 956, 3, 2, 2, 2, 215, 958, 3, 2, 2, 2, 217, 960, 3, 2, 2, 2, 219, 962, 3, 2, 2, 2, 221, 964, 3, 2, 2, 2, 223, 967, 3, 2, 2, 2, 225, 970, 3, 2, 2, 2, 227, 973, 3, 2, 2, 2, 229, 976, 3, 2, 2, 2, 231, 979, 3, 2, 2, 2, 233, 982, 3, 2, 2, 2, 235, 985, 3, 2, 2, 2, 237, 988, 3, 2, 2, 2, 239, 992, 3, 2, 2, 2, 241, 996, 3, 2, 2, 2, 243, 1001, 3, 2, 2, 2, 245, 1004, 3, 2, 2, 2, 247, 1007, 3, 2, 2, 2, 249, 1009, 3, 2, 2, 2, 251, 1014, 3, 2, 2, 2, 253, 1020, 3, 2, 2, 2, 255, 1034, 3, 2, 2, 2, 257, 1045, 3, 2, 2, 2, 259, 1052, 3, 2, 2, 2, 261, 1079, 3, 2, 2, 2, 263, 1081, 3, 2, 2, 2, 265, 1092, 3, 2, 2, 2, 267, 1094, 3, 2, 2, 2, 269, 1106, 3, 2, 2, 2, 271, 1112, 3, 2, 2, 2, 273, 274, 7, 99, 2, 2, 274, 275, 7, 100, 2, 2, 275, 276, 7, 117, 2, 2, 276, 277, 7, 118, 2, 2, 277, 278, 7, 116, 2, 2, 278, 279, 7, 99, 2, 2, 279, 280, 7, 101, 2, 2, 280, 281, 7, 118, 2, 2, 281, 4, 3, 2, 2, 2, 282, 283, 7, 99, 2, 2, 283, 284, 7, 117, 2, 2, 284, 285, 7, 117, 2, 2, 285, 286, 7, 103, 2, 2, 286, 287, 7, 116, 2, 2, 287, 288, 7, 118, 2, 2, 288, 6, 3, 2, 2, 2, 289, 290, 7, 100, 2, 2, 290, 291, 7, 113, 2, 2, 291, 292, 7, 113, 2, 2, 292, 293, 7, 110, 2, 2, 293, 294, 7, 103, 2, 2, 294, 295, 7, 99, 2, 2, 295, 296, 7, 112, 2, 2, 296, 8, 3, 2, 2, 2, 297, 298, 7, 100, 2, 2, 298, 299, 7, 116, 2, 2, 299, 300, 7, 103, 2, 2, 300, 301, 7, 99, 2, 2, 301, 302, 7, 109, 2, 2, 302, 10, 3, 2, 2, 2, 303, 304, 7, 100, 2, 2, 304, 305, 7, 123, 2, 2, 305, 306, 7, 118, 2, 2, 306, 307, 7, 103, 2, 2, 307, 12, 3, 2, 2, 2, 308, 309, 7, 101, 2, 2, 309, 310, 7, 99, 2, 2, 310, 311, 7, 117, 2, 2, 311, 312, 7, 103, 2, 2, 312, 14, 3, 2, 2, 2, 313, 314, 7, 101, 2, 2, 314, 315, 7, 99, 2, 2, 315, 316, 7, 118, 2, 2, 316, 317, 7, 101, 2, 2, 317, 318, 7, 106, 2, 2, 318, 16, 3, 2, 2, 2, 319, 320, 7, 101, 2, 2, 320, 321, 7, 106, 2, 2, 321, 322, 7, 99, 2, 2, 322, 323, 7, 116, 2, 2, 323, 18, 3, 2, 2, 2, 324, 325, 7, 101, 2, 2, 325, 326, 7, 110, 2, 2, 326, 327, 7, 99, 2, 2, 327, 328, 7, 117, 2, 2, 328, 329, 7, 117, 2, 2, 329, 20, 3, 2, 2, 2, 330, 331, 7, 101, 2, 2, 331, 332, 7, 113, 2, 2, 332, 333, 7, 112, 2, 2, 333, 334, 7, 117, 2, 2, 334, 335, 7, 118, 2, 2, 335, 22, 3, 2, 2, 2, 336, 337, 7, 101, 2, 2, 337, 338, 7, 113, 2, 2, 338, 339, 7, 112, 2, 2, 339, 340, 7, 118, 2, 2, 340, 341, 7, 107, 2, 2, 341, 342, 7, 112, 2, 2, 342, 343, 7, 119, 2, 2, 343, 344, 7, 103, 2, 2, 344, 24, 3, 2, 2, 2, 345, 346, 7, 102, 2, 2, 346, 347, 7, 103, 2, 2, 347, 348, 7, 104, 2, 2, 348, 349, 7, 99, 2, 2, 349, 350, 7, 119, 2, 2, 350, 351, 7, 110, 2, 2, 351, 352, 7, 118, 2, 2, 352, 26, 3, 2, 2, 2, 353, 354, 7, 102, 2, 2, 354, 355, 7, 113, 2, 2, 355, 28, 3, 2, 2, 2, 356, 357, 7, 102, 2, 2, 357, 358, 7, 113, 2, 2, 358, 359, 7, 119, 2, 2, 359, 360, 7, 100, 2, 2, 360, 361, 7, 110, 2, 2, 361, 362, 7, 103, 2, 2, 362, 30, 3, 2, 2, 2, 363, 364, 7, 103, 2, 2, 364, 365, 7, 110, 2, 2, 365, 366, 7, 117, 2, 2, 366, 367, 7, 103, 2, 2, 367, 32, 3, 2, 2, 2, 368, 369, 7, 103, 2, 2, 369, 370, 7, 112, 2, 2, 370, 371, 7, 119, 2, 2, 371, 372, 7, 111, 2, 2, 372, 34, 3, 2, 2, 2, 373, 374, 7, 103, 2, 2, 374, 375, 7, 122, 2, 2, 375, 376, 7, 118, 2, 2, 376, 377, 7, 103, 2, 2, 377, 378, 7, 112, 2, 2, 378, 379, 7, 102, 2, 2, 379, 380, 7, 117, 2, 2, 380, 36, 3, 2, 2, 2, 381, 382, 7, 104, 2, 2, 382, 383, 7, 107, 2, 2, 383, 384, 7, 112, 2, 2, 384, 385, 7, 99, 2, 2, 385, 386, 7, 110, 2, 2, 386, 38, 3, 2, 2, 2, 387, 388, 7, 104, 2, 2, 388, 389, 7, 107, 2, 2, 389, 390, 7, 112, 2, 2, 390, 391, 7, 99, 2, 2, 391, 392, 7, 110, 2, 2, 392, 393, 7, 110, 2, 2, 393, 394, 7, 123, 2, 2, 394, 40, 3, 2, 2, 2, 395, 396, 7, 104, 2, 2, 396, 397, 7, 110, 2, 2, 397, 398, 7, 113, 2, 2, 398, 399, 7, 99, 2, 2, 399, 400, 7, 118, 2, 2, 400, 42, 3, 2, 2, 2, 401, 402, 7, 104, 2, 2, 402, 403, 7, 113, 2, 2, 403, 404, 7, 116, 2, 2, 404, 44, 3, 2, 2, 2, 405, 406, 7, 107, 2, 2, 406, 407, 7, 104, 2, 2, 407, 46, 3, 2, 2, 2, 408, 409, 7, 105, 2, 2, 409, 410, 7, 113, 2, 2, 410, 411, 7, 118, 2, 2, 411, 412, 7, 113, 2, 2, 412, 48, 3, 2, 2, 2, 413, 414, 7, 107, 2, 2, 414, 415, 7, 111, 2, 2, 415, 416, 7, 114, 2, 2, 416, 417, 7, 110, 2, 2, 417, 418, 7, 103, 2, 2, 418, 419, 7, 111, 2, 2, 419, 420, 7, 103, 2, 2, 420, 421, 7, 112, 2, 2, 421, 422, 7, 118, 2, 2, 422, 423, 7, 117, 2, 2, 423, 50, 3, 2, 2, 2, 424, 425, 7, 107, 2, 2, 425, 426, 7, 111, 2, 2, 426, 427, 7, 114, 2, 2, 427, 428, 7, 113, 2, 2, 428, 429, 7, 116, 2, 2, 429, 430, 7, 118, 2, 2, 430, 52, 3, 2, 2, 2, 431, 432, 7, 107, 2, 2, 432, 433, 7, 112, 2, 2, 433, 434, 7, 117, 2, 2, 434, 435, 7, 118, 2, 2, 435, 436, 7, 99, 2, 2, 436, 437, 7, 112, 2, 2, 437, 438, 7, 101, 2, 2, 438, 439, 7, 103, 2, 2, 439, 440, 7, 113, 2, 2, 440, 441, 7, 104, 2, 2, 441, 54, 3, 2, 2, 2, 442, 443, 7, 107, 2, 2, 443, 444, 7, 112, 2, 2, 444, 445, 7, 118, 2, 2, 445, 56, 3, 2, 2, 2, 446, 447, 7, 107, 2, 2, 447, 448, 7, 112, 2, 2, 448, 449, 7, 118, 2, 2, 449, 450, 7, 103, 2, 2, 450, 451, 7, 116, 2, 2, 451, 452, 7, 104, 2, 2, 452, 453, 7, 99, 2, 2, 453, 454, 7, 101, 2, 2, 454, 455, 7, 103, 2, 2, 455, 58, 3, 2, 2, 2, 456, 457, 7, 110, 2, 2, 457, 458, 7, 113, 2, 2, 458, 459, 7, 112, 2, 2, 459, 460, 7, 105, 2, 2, 460, 60, 3, 2, 2, 2, 461, 462, 7, 112, 2, 2, 462, 463, 7, 99, 2, 2, 463, 464, 7, 118, 2, 2, 464, 465, 7, 107, 2, 2, 465, 466, 7, 120, 2, 2, 466, 467, 7, 103, 2, 2, 467, 62, 3, 2, 2, 2, 468, 469, 7, 112, 2, 2, 469, 470, 7, 103, 2, 2, 470, 471, 7, 121, 2, 2, 471, 64, 3, 2, 2, 2, 472, 473, 7, 114, 2, 2, 473, 474, 7, 99, 2, 2, 474, 475, 7, 101, 2, 2, 475, 476, 7, 109, 2, 2, 476, 477, 7, 99, 2, 2, 477, 478, 7, 105, 2, 2, 478, 479, 7, 103, 2, 2, 479, 66, 3, 2, 2, 2, 480, 481, 7, 114, 2, 2, 481, 482, 7, 116, 2, 2, 482, 483, 7, 107, 2, 2, 483, 484, 7, 120, 2, 2, 484, 485, 7, 99, 2, 2, 485, 486, 7, 118, 2, 2, 486, 487, 7, 103, 2, 2, 487, 68, 3, 2, 2, 2, 488, 489, 7, 114, 2, 2, 489, 490, 7, 116, 2, 2, 490, 491, 7, 113, 2, 2, 491, 492, 7, 118, 2, 2, 492, 493, 7, 103, 2, 2, 493, 494, 7, 101, 2, 2, 494, 495, 7, 118, 2, 2, 495, 496, 7, 103, 2, 2, 496, 497, 7, 102, 2, 2, 497, 70, 3, 2, 2, 2, 498, 499, 7, 114, 2, 2, 499, 500, 7, 119, 2, 2, 500, 501, 7, 100, 2, 2, 501, 502, 7, 110, 2, 2, 502, 503, 7, 107, 2, 2, 503, 504, 7, 101, 2, 2, 504, 72, 3, 2, 2, 2, 505, 506, 7, 116, 2, 2, 506, 507, 7, 103, 2, 2, 507, 508, 7, 118, 2, 2, 508, 509, 7, 119, 2, 2, 509, 510, 7, 116, 2, 2, 510, 511, 7, 112, 2, 2, 511, 74, 3, 2, 2, 2, 512, 513, 7, 117, 2, 2, 513, 514, 7, 106, 2, 2, 514, 515, 7, 113, 2, 2, 515, 516, 7, 116, 2, 2, 516, 517, 7, 118, 2, 2, 517, 76, 3, 2, 2, 2, 518, 519, 7, 117, 2, 2, 519, 520, 7, 118, 2, 2, 520, 521, 7, 99, 2, 2, 521, 522, 7, 118, 2, 2, 522, 523, 7, 107, 2, 2, 523, 524, 7, 101, 2, 2, 524, 78, 3, 2, 2, 2, 525, 526, 7, 117, 2, 2, 526, 527, 7, 118, 2, 2, 527, 528, 7, 116, 2, 2, 528, 529, 7, 107, 2, 2, 529, 530, 7, 101, 2, 2, 530, 531, 7, 118, 2, 2, 531, 532, 7, 104, 2, 2, 532, 533, 7, 114, 2, 2, 533, 80, 3, 2, 2, 2, 534, 535, 7, 117, 2, 2, 535, 536, 7, 119, 2, 2, 536, 537, 7, 114, 2, 2, 537, 538, 7, 103, 2, 2, 538, 539, 7, 116, 2, 2, 539, 82, 3, 2, 2, 2, 540, 541, 7, 117, 2, 2, 541, 542, 7, 121, 2, 2, 542, 543, 7, 107, 2, 2, 543, 544, 7, 118, 2, 2, 544, 545, 7, 101, 2, 2, 545, 546, 7, 106, 2, 2, 546, 84, 3, 2, 2, 2, 547, 548, 7, 117, 2, 2, 548, 549, 7, 123, 2, 2, 549, 550, 7, 112, 2, 2, 550, 551, 7, 101, 2, 2, 551, 552, 7, 106, 2, 2, 552, 553, 7, 116, 2, 2, 553, 554, 7, 113, 2, 2, 554, 555, 7, 112, 2, 2, 555, 556, 7, 107, 2, 2, 556, 557, 7, 124, 2, 2, 557, 558, 7, 103, 2, 2, 558, 559, 7, 102, 2, 2, 559, 86, 3, 2, 2, 2, 560, 561, 7, 118, 2, 2, 561, 562, 7, 106, 2, 2, 562, 563, 7, 107, 2, 2, 563, 564, 7, 117, 2, 2, 564, 88, 3, 2, 2, 2, 565, 566, 7, 118, 2, 2, 566, 567, 7, 106, 2, 2, 567, 568, 7, 116, 2, 2, 568, 569, 7, 113, 2, 2, 569, 570, 7, 121, 2, 2, 570, 90, 3, 2, 2, 2, 571, 572, 7, 118, 2, 2, 572, 573, 7, 106, 2, 2, 573, 574, 7, 116, 2, 2, 574, 575, 7, 113, 2, 2, 575, 576, 7, 121, 2, 2, 576, 577, 7, 117, 2, 2, 577, 92, 3, 2, 2, 2, 578, 579, 7, 118, 2, 2, 579, 580, 7, 116, 2, 2, 580, 581, 7, 99, 2, 2, 581, 582, 7, 112, 2, 2, 582, 583, 7, 117, 2, 2, 583, 584, 7, 107, 2, 2, 584, 585, 7, 103, 2, 2, 585, 586, 7, 112, 2, 2, 586, 587, 7, 118, 2, 2, 587, 94, 3, 2, 2, 2, 588, 589, 7, 118, 2, 2, 589, 590, 7, 116, 2, 2, 590, 591, 7, 123, 2, 2, 591, 96, 3, 2, 2, 2, 592, 593, 7, 120, 2, 2, 593, 594, 7, 113, 2, 2, 594, 595, 7, 107, 2, 2, 595, 596, 7, 102, 2, 2, 596, 98, 3, 2, 2, 2, 597, 598, 7, 120, 2, 2, 598, 599, 7, 113, 2, 2, 599, 600, 7, 110, 2, 2, 600, 601, 7, 99, 2, 2, 601, 602, 7, 118, 2, 2, 602, 603, 7, 107, 2, 2, 603, 604, 7, 110, 2, 2, 604, 605, 7, 103, 2, 2, 605, 100, 3, 2, 2, 2, 606, 607, 7, 121, 2, 2, 607, 608, 7, 106, 2, 2, 608, 609, 7, 107, 2, 2, 609, 610, 7, 110, 2, 2, 610, 611, 7, 103, 2, 2, 611, 102, 3, 2, 2, 2, 612, 613, 7, 111, 2, 2, 613, 614, 7, 113, 2, 2, 614, 615, 7, 102, 2, 2, 615, 616, 7, 119, 2, 2, 616, 617, 7, 110, 2, 2, 617, 618, 7, 103, 2, 2, 618, 104, 3, 2, 2, 2, 619, 620, 7, 113, 2, 2, 620, 621, 7, 114, 2, 2, 621, 622, 7, 103, 2, 2, 622, 623, 7, 112, 2, 2, 623, 106, 3, 2, 2, 2, 624, 625, 7, 116, 2, 2, 625, 626, 7, 103, 2, 2, 626, 627, 7, 115, 2, 2, 627, 628, 7, 119, 2, 2, 628, 629, 7, 107, 2, 2, 629, 630, 7, 116, 2, 2, 630, 631, 7, 103, 2, 2, 631, 632, 7, 117, 2, 2, 632, 108, 3, 2, 2, 2, 633, 634, 7, 103, 2, 2, 634, 635, 7, 122, 2, 2, 635, 636, 7, 114, 2, 2, 636, 637, 7, 113, 2, 2, 637, 638, 7, 116, 2, 2, 638, 639, 7, 118, 2, 2, 639, 640, 7, 117, 2, 2, 640, 110, 3, 2, 2, 2, 641, 642, 7, 113, 2, 2, 642, 643, 7, 114, 2, 2, 643, 644, 7, 103, 2, 2, 644, 645, 7, 112, 2, 2, 645, 646, 7, 117, 2, 2, 646, 112, 3, 2, 2, 2, 647, 648, 7, 118, 2, 2, 648, 649, 7, 113, 2, 2, 649, 114, 3, 2, 2, 2, 650, 651, 7, 119, 2, 2, 651, 652, 7, 117, 2, 2, 652, 653, 7, 103, 2, 2, 653, 654, 7, 117, 2, 2, 654, 116, 3, 2, 2, 2, 655, 656, 7, 114, 2, 2, 656, 657, 7, 116, 2, 2, 657, 658, 7, 113, 2, 2, 658, 659, 7, 120, 2, 2, 659, 660, 7, 107, 2, 2, 660, 661, 7, 102, 2, 2, 661, 662, 7, 103, 2, 2, 662, 663, 7, 117, 2, 2, 663, 118, 3, 2, 2, 2, 664, 665, 7, 121, 2, 2, 665, 666, 7, 107, 2, 2, 666, 667, 7, 118, 2, 2, 667, 668, 7, 106, 2, 2, 668, 120, 3, 2, 2, 2, 669, 670, 7, 118, 2, 2, 670, 671, 7, 116, 2, 2, 671, 672, 7, 99, 2, 2, 672, 673, 7, 112, 2, 2, 673, 674, 7, 117, 2, 2, 674, 675, 7, 107, 2, 2, 675, 676, 7, 118, 2, 2, 676, 677, 7, 107, 2, 2, 677, 678, 7, 120, 2, 2, 678, 679, 7, 103, 2, 2, 679, 122, 3, 2, 2, 2, 680, 681, 7, 120, 2, 2, 681, 682, 7, 99, 2, 2, 682, 683, 7, 116, 2, 2, 683, 124, 3, 2, 2, 2, 684, 685, 7, 123, 2, 2, 685, 686, 7, 107, 2, 2, 686, 687, 7, 103, 2, 2, 687, 688, 7, 110, 2, 2, 688, 689, 7, 102, 2, 2, 689, 126, 3, 2, 2, 2, 690, 691, 7, 116, 2, 2, 691, 692, 7, 103, 2, 2, 692, 693, 7, 101, 2, 2, 693, 694, 7, 113, 2, 2, 694, 695, 7, 116, 2, 2, 695, 696, 7, 102, 2, 2, 696, 128, 3, 2, 2, 2, 697, 698, 7, 117, 2, 2, 698, 699, 7, 103, 2, 2, 699, 700, 7, 99, 2, 2, 700, 701, 7, 110, 2, 2, 701, 702, 7, 103, 2, 2, 702, 703, 7, 102, 2, 2, 703, 130, 3, 2, 2, 2, 704, 705, 7, 114, 2, 2, 705, 706, 7, 103, 2, 2, 706, 707, 7, 116, 2, 2, 707, 708, 7, 111, 2, 2, 708, 709, 7, 107, 2, 2, 709, 710, 7, 118, 2, 2, 710, 711, 7, 117, 2, 2, 711, 132, 3, 2, 2, 2, 712, 713, 7, 112, 2, 2, 713, 714, 7, 113, 2, 2, 714, 715, 7, 112, 2, 2, 715, 716, 7, 47, 2, 2, 716, 717, 7, 117, 2, 2, 717, 718, 7, 103, 2, 2, 718, 719, 7, 99, 2, 2, 719, 720, 7, 110, 2, 2, 720, 721, 7, 103, 2, 2, 721, 722, 7, 102, 2, 2, 722, 134, 3, 2, 2, 2, 723, 737, 7, 50, 2, 2, 724, 734, 9, 2, 2, 2, 725, 727, 5, 267, 134, 2, 726, 725, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 735, 3, 2, 2, 2, 728, 730, 7, 97, 2, 2, 729, 728, 3, 2, 2, 2, 730, 731, 3, 2, 2, 2, 731, 729, 3, 2, 2, 2, 731, 732, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, 735, 5, 267, 134, 2, 734, 726, 3, 2, 2, 2, 734, 729, 3, 2, 2, 2, 735, 737, 3, 2, 2, 2, 736, 723, 3, 2, 2, 2, 736, 724, 3, 2, 2, 2, 737, 739, 3, 2, 2, 2, 738, 740, 9, 3, 2, 2, 739, 738, 3, 2, 2, 2, 739, 740, 3, 2, 2, 2, 740, 136, 3, 2, 2, 2, 741, 742, 7, 50, 2, 2, 742, 743, 9, 4, 2, 2, 743, 751, 9, 5, 2, 2, 744, 746, 9, 6, 2, 2, 745, 744, 3, 2, 2, 2, 746, 749, 3, 2, 2, 2, 747, 745, 3, 2, 2, 2, 747, 748, 3, 2, 2, 2, 748, 750, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 750, 752, 9, 5, 2, 2, 751, 747, 3, 2, 2, 2, 751, 752, 3, 2, 2, 2, 752, 754, 3, 2, 2, 2, 753, 755, 9, 3, 2, 2, 754, 753, 3, 2, 2, 2, 754, 755, 3, 2, 2, 2, 755, 138, 3, 2, 2, 2, 756, 760, 7, 50, 2, 2, 757, 759, 7, 97, 2, 2, 758, 757, 3, 2, 2, 2, 759, 762, 3, 2, 2, 2, 760, 758, 3, 2, 2, 2, 760, 761, 3, 2, 2, 2, 761, 763, 3, 2, 2, 2, 762, 760, 3, 2, 2, 2, 763, 771, 9, 7, 2, 2, 764, 766, 9, 8, 2, 2, 765, 764, 3, 2, 2, 2, 766, 769, 3, 2, 2, 2, 767, 765, 3, 2, 2, 2, 767, 768, 3, 2, 2, 2, 768, 770, 3, 2, 2, 2, 769, 767, 3, 2, 2, 2, 770, 772, 9, 7, 2, 2, 771, 767, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 774, 3, 2, 2, 2, 773, 775, 9, 3, 2, 2, 774, 773, 3, 2, 2, 2, 774, 775, 3, 2, 2, 2, 775, 140, 3, 2, 2, 2, 776, 777, 7, 50, 2, 2, 777, 778, 9, 9, 2, 2, 778, 786, 9, 10, 2, 2, 779, 781, 9, 11, 2, 2, 780, 779, 3, 2, 2, 2, 781, 784, 3, 2, 2, 2, 782, 780, 3, 2, 2, 2, 782, 783, 3, 2, 2, 2, 783, 785, 3, 2, 2, 2, 784, 782, 3, 2, 2, 2, 785, 787, 9, 10, 2, 2, 786, 782, 3, 2, 2, 2, 786, 787, 3, 2, 2, 2, 787, 789, 3, 2, 2, 2, 788, 790, 9, 3, 2, 2, 789, 788, 3, 2, 2, 2, 789, 790, 3, 2, 2, 2, 790, 142, 3, 2, 2, 2, 791, 792, 5, 267, 134, 2, 792, 794, 7, 48, 2, 2, 793, 795, 5, 267, 134, 2, 794, 793, 3, 2, 2, 2, 794, 795, 3, 2, 2, 2, 795, 799, 3, 2, 2, 2, 796, 797, 7, 48, 2, 2, 797, 799, 5, 267, 134, 2, 798, 791, 3, 2, 2, 2, 798, 796, 3, 2, 2, 2, 799, 801, 3, 2, 2, 2, 800, 802, 5, 259, 130, 2, 801, 800, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 804, 3, 2, 2, 2, 803, 805, 9, 12, 2, 2, 804, 803, 3, 2, 2, 2, 804, 805, 3, 2, 2, 2, 805, 815, 3, 2, 2, 2, 806, 812, 5, 267, 134, 2, 807, 809, 5, 259, 130, 2, 808, 810, 9, 12, 2, 2, 809, 808, 3, 2, 2, 2, 809, 810, 3, 2, 2, 2, 810, 813, 3, 2, 2, 2, 811, 813, 9, 12, 2, 2, 812, 807, 3, 2, 2, 2, 812, 811, 3, 2, 2, 2, 813, 815, 3, 2, 2, 2, 814, 798, 3, 2, 2, 2, 814, 806, 3, 2, 2, 2, 815, 144, 3, 2, 2, 2, 816, 817, 7, 50, 2, 2, 817, 827, 9, 4, 2, 2, 818, 820, 5, 263, 132, 2, 819, 821, 7, 48, 2, 2, 820, 819, 3, 2, 2, 2, 820, 821, 3, 2, 2, 2, 821, 828, 3, 2, 2, 2, 822, 824, 5, 263, 132, 2, 823, 822, 3, 2, 2, 2, 823, 824, 3, 2, 2, 2, 824, 825, 3, 2, 2, 2, 825, 826, 7, 48, 2, 2, 826, 828, 5, 263, 132, 2, 827, 818, 3, 2, 2, 2, 827, 823, 3, 2, 2, 2, 828, 829, 3, 2, 2, 2, 829, 831, 9, 13, 2, 2, 830, 832, 9, 14, 2, 2, 831, 830, 3, 2, 2, 2, 831, 832, 3, 2, 2, 2, 832, 833, 3, 2, 2, 2, 833, 835, 5, 267, 134, 2, 834, 836, 9, 12, 2, 2, 835, 834, 3, 2, 2, 2, 835, 836, 3, 2, 2, 2, 836, 146, 3, 2, 2, 2, 837, 838, 7, 118, 2, 2, 838, 839, 7, 116, 2, 2, 839, 840, 7, 119, 2, 2, 840, 847, 7, 103, 2, 2, 841, 842, 7, 104, 2, 2, 842, 843, 7, 99, 2, 2, 843, 844, 7, 110, 2, 2, 844, 845, 7, 117, 2, 2, 845, 847, 7, 103, 2, 2, 846, 837, 3, 2, 2, 2, 846, 841, 3, 2, 2, 2, 847, 148, 3, 2, 2, 2, 848, 851, 7, 41, 2, 2, 849, 852, 10, 15, 2, 2, 850, 852, 5, 261, 131, 2, 851, 849, 3, 2, 2, 2, 851, 850, 3, 2, 2, 2, 852, 853, 3, 2, 2, 2, 853, 854, 7, 41, 2, 2, 854, 150, 3, 2, 2, 2, 855, 860, 7, 36, 2, 2, 856, 859, 10, 16, 2, 2, 857, 859, 5, 261, 131, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 862, 3, 2, 2, 2, 860, 858, 3, 2, 2, 2, 860, 861, 3, 2, 2, 2, 861, 863, 3, 2, 2, 2, 862, 860, 3, 2, 2, 2, 863, 864, 7, 36, 2, 2, 864, 152, 3, 2, 2, 2, 865, 866, 7, 36, 2, 2, 866, 867, 7, 36, 2, 2, 867, 868, 7, 36, 2, 2, 868, 872, 3, 2, 2, 2, 869, 871, 9, 17, 2, 2, 870, 869, 3, 2, 2, 2, 871, 874, 3, 2, 2, 2, 872, 870, 3, 2, 2, 2, 872, 873, 3, 2, 2, 2, 873, 875, 3, 2, 2, 2, 874, 872, 3, 2, 2, 2, 875, 880, 9, 18, 2, 2, 876, 879, 11, 2, 2, 2, 877, 879, 5, 261, 131, 2, 878, 876, 3, 2, 2, 2, 878, 877, 3, 2, 2, 2, 879, 882, 3, 2, 2, 2, 880, 881, 3, 2, 2, 2, 880, 878, 3, 2, 2, 2, 881, 883, 3, 2, 2, 2, 882, 880, 3, 2, 2, 2, 883, 884, 7, 36, 2, 2, 884, 885, 7, 36, 2, 2, 885, 886, 7, 36, 2, 2, 886, 154, 3, 2, 2, 2, 887, 888, 7, 112, 2, 2, 888, 889, 7, 119, 2, 2, 889, 890, 7, 110, 2, 2, 890, 891, 7, 110, 2, 2, 891, 156, 3, 2, 2, 2, 892, 893, 7, 42, 2, 2, 893, 158, 3, 2, 2, 2, 894, 895, 7, 43, 2, 2, 895, 160, 3, 2, 2, 2, 896, 897, 7, 125, 2, 2, 897, 162, 3, 2, 2, 2, 898, 899, 7, 127, 2, 2, 899, 164, 3, 2, 2, 2, 900, 901, 7, 93, 2, 2, 901, 166, 3, 2, 2, 2, 902, 903, 7, 95, 2, 2, 903, 168, 3, 2, 2, 2, 904, 905, 7, 61, 2, 2, 905, 170, 3, 2, 2, 2, 906, 907, 7, 46, 2, 2, 907, 172, 3, 2, 2, 2, 908, 909, 7, 48, 2, 2, 909, 174, 3, 2, 2, 2, 910, 911, 7, 63, 2, 2, 911, 176, 3, 2, 2, 2, 912, 913, 7, 64, 2, 2, 913, 178, 3, 2, 2, 2, 914, 915, 7, 62, 2, 2, 915, 180, 3, 2, 2, 2, 916, 917, 7, 35, 2, 2, 917, 182, 3, 2, 2, 2, 918, 919, 7, 128, 2, 2, 919, 184, 3, 2, 2, 2, 920, 921, 7, 65, 2, 2, 921, 186, 3, 2, 2, 2, 922, 923, 7, 60, 2, 2, 923, 188, 3, 2, 2, 2, 924, 925, 7, 63, 2, 2, 925, 926, 7, 63, 2, 2, 926, 190, 3, 2, 2, 2, 927, 928, 7, 62, 2, 2, 928, 929, 7, 63, 2, 2, 929, 192, 3, 2, 2, 2, 930, 931, 7, 64, 2, 2, 931, 932, 7, 63, 2, 2, 932, 194, 3, 2, 2, 2, 933, 934, 7, 35, 2, 2, 934, 935, 7, 63, 2, 2, 935, 196, 3, 2, 2, 2, 936, 937, 7, 40, 2, 2, 937, 938, 7, 40, 2, 2, 938, 198, 3, 2, 2, 2, 939, 940, 7, 126, 2, 2, 940, 941, 7, 126, 2, 2, 941, 200, 3, 2, 2, 2, 942, 943, 7, 45, 2, 2, 943, 944, 7, 45, 2, 2, 944, 202, 3, 2, 2, 2, 945, 946, 7, 47, 2, 2, 946, 947, 7, 47, 2, 2, 947, 204, 3, 2, 2, 2, 948, 949, 7, 45, 2, 2, 949, 206, 3, 2, 2, 2, 950, 951, 7, 47, 2, 2, 951, 208, 3, 2, 2, 2, 952, 953, 7, 44, 2, 2, 953, 210, 3, 2, 2, 2, 954, 955, 7, 49, 2, 2, 955, 212, 3, 2, 2, 2, 956, 957, 7, 40, 2, 2, 957, 214, 3, 2, 2, 2, 958, 959, 7, 126, 2, 2, 959, 216, 3, 2, 2, 2, 960, 961, 7, 96, 2, 2, 961, 218, 3, 2, 2, 2, 962, 963, 7, 39, 2, 2, 963, 220, 3, 2, 2, 2, 964, 965, 7, 45, 2, 2, 965, 966, 7, 63, 2, 2, 966, 222, 3, 2, 2, 2, 967, 968, 7, 47, 2, 2, 968, 969, 7, 63, 2, 2, 969, 224, 3, 2, 2, 2, 970, 971, 7, 44, 2, 2, 971, 972, 7, 63, 2, 2, 972, 226, 3, 2, 2, 2, 973, 974, 7, 49, 2, 2, 974, 975, 7, 63, 2, 2, 975, 228, 3, 2, 2, 2, 976, 977, 7, 40, 2, 2, 977, 978, 7, 63, 2, 2, 978, 230, 3, 2, 2, 2, 979, 980, 7, 126, 2, 2, 980, 981, 7, 63, 2, 2, 981, 232, 3, 2, 2, 2, 982, 983, 7, 96, 2, 2, 983, 984, 7, 63, 2, 2, 984, 234, 3, 2, 2, 2, 985, 986, 7, 39, 2, 2, 986, 987, 7, 63, 2, 2, 987, 236, 3, 2, 2, 2, 988, 989, 7, 62, 2, 2, 989, 990, 7, 62, 2, 2, 990, 991, 7, 63, 2, 2, 991, 238, 3, 2, 2, 2, 992, 993, 7, 64, 2, 2, 993, 994, 7, 64, 2, 2, 994, 995, 7, 63, 2, 2, 995, 240, 3, 2, 2, 2, 996, 997, 7, 64, 2, 2, 997, 998, 7, 64, 2, 2, 998, 999, 7, 64, 2, 2, 999, 1000, 7, 63, 2, 2, 1000, 242, 3, 2, 2, 2, 1001, 1002, 7, 47, 2, 2, 1002, 1003, 7, 64, 2, 2, 1003, 244, 3, 2, 2, 2, 1004, 1005, 7, 60, 2, 2, 1005, 1006, 7, 60, 2, 2, 1006, 246, 3, 2, 2, 2, 1007, 1008, 7, 66, 2, 2, 1008, 248, 3, 2, 2, 2, 1009, 1010, 7, 48, 2, 2, 1010, 1011, 7, 48, 2, 2, 1011, 1012, 7, 48, 2, 2, 1012, 250, 3, 2, 2, 2, 1013, 1015, 9, 19, 2, 2, 1014, 1013, 3, 2, 2, 2, 1015, 1016, 3, 2, 2, 2, 1016, 1014, 3, 2, 2, 2, 1016, 1017, 3, 2, 2, 2, 1017, 1018, 3, 2, 2, 2, 1018, 1019, 8, 126, 2, 2, 1019, 252, 3, 2, 2, 2, 1020, 1021, 7, 49, 2, 2, 1021, 1022, 7, 44, 2, 2, 1022, 1026, 3, 2, 2, 2, 1023, 1025, 11, 2, 2, 2, 1024, 1023, 3, 2, 2, 2, 1025, 1028, 3, 2, 2, 2, 1026, 1027, 3, 2, 2, 2, 1026, 1024, 3, 2, 2, 2, 1027, 1029, 3, 2, 2, 2, 1028, 1026, 3, 2, 2, 2, 1029, 1030, 7, 44, 2, 2, 1030, 1031, 7, 49, 2, 2, 1031, 1032, 3, 2, 2, 2, 1032, 1033, 8, 127, 2, 2, 1033, 254, 3, 2, 2, 2, 1034, 1035, 7, 49, 2, 2, 1035, 1036, 7, 49, 2, 2, 1036, 1040, 3, 2, 2, 2, 1037, 1039, 10, 18, 2, 2, 1038, 1037, 3, 2, 2, 2, 1039, 1042, 3, 2, 2, 2, 1040, 1038, 3, 2, 2, 2, 1040, 1041, 3, 2, 2, 2, 1041, 1043, 3, 2, 2, 2, 1042, 1040, 3, 2, 2, 2, 1043, 1044, 8, 128, 2, 2, 1044, 256, 3, 2, 2, 2, 1045, 1049, 5, 271, 136, 2, 1046, 1048, 5, 269, 135, 2, 1047, 1046, 3, 2, 2, 2, 1048, 1051, 3, 2, 2, 2, 1049, 1047, 3, 2, 2, 2, 1049, 1050, 3, 2, 2, 2, 1050, 258, 3, 2, 2, 2, 1051, 1049, 3, 2, 2, 2, 1052, 1054, 9, 20, 2, 2, 1053, 1055, 9, 14, 2, 2, 1054, 1053, 3, 2, 2, 2, 1054, 1055, 3, 2, 2, 2, 1055, 1056, 3, 2, 2, 2, 1056, 1057, 5, 267, 134, 2, 1057, 260, 3, 2, 2, 2, 1058, 1059, 7, 94, 2, 2, 1059, 1080, 9, 21, 2, 2, 1060, 1065, 7, 94, 2, 2, 1061, 1063, 9, 22, 2, 2, 1062, 1061, 3, 2, 2, 2, 1062, 1063, 3, 2, 2, 2, 1063, 1064, 3, 2, 2, 2, 1064, 1066, 9, 7, 2, 2, 1065, 1062, 3, 2, 2, 2, 1065, 1066, 3, 2, 2, 2, 1066, 1067, 3, 2, 2, 2, 1067, 1080, 9, 7, 2, 2, 1068, 1070, 7, 94, 2, 2, 1069, 1071, 7, 119, 2, 2, 1070, 1069, 3, 2, 2, 2, 1071, 1072, 3, 2, 2, 2, 1072, 1070, 3, 2, 2, 2, 1072, 1073, 3, 2, 2, 2, 1073, 1074, 3, 2, 2, 2, 1074, 1075, 5, 265, 133, 2, 1075, 1076, 5, 265, 133, 2, 1076, 1077, 5, 265, 133, 2, 1077, 1078, 5, 265, 133, 2, 1078, 1080, 3, 2, 2, 2, 1079, 1058, 3, 2, 2, 2, 1079, 1060, 3, 2, 2, 2, 1079, 1068, 3, 2, 2, 2, 1080, 262, 3, 2, 2, 2, 1081, 1090, 5, 265, 133, 2, 1082, 1085, 5, 265, 133, 2, 1083, 1085, 7, 97, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1083, 3, 2, 2, 2, 1085, 1088, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1086, 1087, 3, 2, 2, 2, 1087, 1089, 3, 2, 2, 2, 1088, 1086, 3, 2, 2, 2, 1089, 1091, 5, 265, 133, 2, 1090, 1086, 3, 2, 2, 2, 1090, 1091, 3, 2, 2, 2, 1091, 264, 3, 2, 2, 2, 1092, 1093, 9, 5, 2, 2, 1093, 266, 3, 2, 2, 2, 1094, 1102, 9, 23, 2, 2, 1095, 1097, 9, 24, 2, 2, 1096, 1095, 3, 2, 2, 2, 1097, 1100, 3, 2, 2, 2, 1098, 1096, 3, 2, 2, 2, 1098, 1099, 3, 2, 2, 2, 1099, 1101, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1101, 1103, 9, 23, 2, 2, 1102, 1098, 3, 2, 2, 2, 1102, 1103, 3, 2, 2, 2, 1103, 268, 3, 2, 2, 2, 1104, 1107, 5, 271, 136, 2, 1105, 1107, 9, 23, 2, 2, 1106, 1104, 3, 2, 2, 2, 1106, 1105, 3, 2, 2, 2, 1107, 270, 3, 2, 2, 2, 1108, 1113, 9, 25, 2, 2, 1109, 1113, 10, 26, 2, 2, 1110, 1111, 9, 27, 2, 2, 1111, 1113, 9, 28, 2, 2, 1112, 1108, 3, 2, 2, 2, 1112, 1109, 3, 2, 2, 2, 1112, 1110, 3, 2, 2, 2, 1113, 272, 3, 2, 2, 2, 53, 2, 726, 731, 734, 736, 739, 747, 751, 754, 760, 767, 771, 774, 782, 786, 789, 794, 798, 801, 804, 809, 812, 814, 820, 823, 827, 831, 835, 846, 851, 858, 860, 872, 878, 880, 1016, 1026, 1040, 1049, 1054, 1062, 1065, 1072, 1079, 1084, 1086, 1090, 1098, 1102, 1106, 1112, 3, 2, 3, 2] \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java new file mode 100644 index 00000000..1b4d6730 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java @@ -0,0 +1,581 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class JavaLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, + CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, + ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, + IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, + NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, + SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, + THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, + WHILE=50, MODULE=51, OPEN=52, REQUIRES=53, EXPORTS=54, OPENS=55, TO=56, + USES=57, PROVIDES=58, WITH=59, TRANSITIVE=60, VAR=61, YIELD=62, RECORD=63, + SEALED=64, PERMITS=65, NON_SEALED=66, DECIMAL_LITERAL=67, HEX_LITERAL=68, + OCT_LITERAL=69, BINARY_LITERAL=70, FLOAT_LITERAL=71, HEX_FLOAT_LITERAL=72, + BOOL_LITERAL=73, CHAR_LITERAL=74, STRING_LITERAL=75, TEXT_BLOCK=76, NULL_LITERAL=77, + LPAREN=78, RPAREN=79, LBRACE=80, RBRACE=81, LBRACK=82, RBRACK=83, SEMI=84, + COMMA=85, DOT=86, ASSIGN=87, GT=88, LT=89, BANG=90, TILDE=91, QUESTION=92, + COLON=93, EQUAL=94, LE=95, GE=96, NOTEQUAL=97, AND=98, OR=99, INC=100, + DEC=101, ADD=102, SUB=103, MUL=104, DIV=105, BITAND=106, BITOR=107, CARET=108, + MOD=109, ADD_ASSIGN=110, SUB_ASSIGN=111, MUL_ASSIGN=112, DIV_ASSIGN=113, + AND_ASSIGN=114, OR_ASSIGN=115, XOR_ASSIGN=116, MOD_ASSIGN=117, LSHIFT_ASSIGN=118, + RSHIFT_ASSIGN=119, URSHIFT_ASSIGN=120, ARROW=121, COLONCOLON=122, AT=123, + ELLIPSIS=124, WS=125, COMMENT=126, LINE_COMMENT=127, IDENTIFIER=128; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", "CHAR", + "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", "ENUM", + "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", "IMPLEMENTS", + "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", + "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", + "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", + "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", "OPEN", "REQUIRES", + "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", "TRANSITIVE", "VAR", + "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", "DECIMAL_LITERAL", + "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL", + "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", "TEXT_BLOCK", "NULL_LITERAL", + "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "SEMI", "COMMA", + "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION", "COLON", "EQUAL", + "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD", "SUB", "MUL", + "DIV", "BITAND", "BITOR", "CARET", "MOD", "ADD_ASSIGN", "SUB_ASSIGN", + "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", "OR_ASSIGN", "XOR_ASSIGN", + "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", "URSHIFT_ASSIGN", "ARROW", + "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT", "IDENTIFIER", + "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits", + "LetterOrDigit", "Letter" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'", "'case'", + "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'", + "'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", + "'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", + "'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'", + "'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'", + "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", + "'transient'", "'try'", "'void'", "'volatile'", "'while'", "'module'", + "'open'", "'requires'", "'exports'", "'opens'", "'to'", "'uses'", "'provides'", + "'with'", "'transitive'", "'var'", "'yield'", "'record'", "'sealed'", + "'permits'", "'non-sealed'", null, null, null, null, null, null, null, + null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'", + "';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", + "'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", + "'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", + "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'->'", + "'::'", "'@'", "'...'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", + "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", + "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", + "IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", + "NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", + "STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", + "THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", + "OPEN", "REQUIRES", "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", + "TRANSITIVE", "VAR", "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", + "DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", + "HEX_FLOAT_LITERAL", "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", + "TEXT_BLOCK", "NULL_LITERAL", "LPAREN", "RPAREN", "LBRACE", "RBRACE", + "LBRACK", "RBRACK", "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", + "TILDE", "QUESTION", "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", + "OR", "INC", "DEC", "ADD", "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", + "MOD", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", + "OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", + "URSHIFT_ASSIGN", "ARROW", "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", + "LINE_COMMENT", "IDENTIFIER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public JavaLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "JavaLexer.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u0082\u045a\b\1\4"+ + "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ + "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ + "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ + "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ + " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ + "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ + "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t"+ + "=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4"+ + "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\t"+ + "T\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_"+ + "\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k"+ + "\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv"+ + "\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t"+ + "\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084"+ + "\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\3\2\3"+ + "\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4"+ + "\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3"+ + "\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n"+ + "\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ + "\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17"+ + "\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21"+ + "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23"+ + "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25"+ + "\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31"+ + "\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32"+ + "\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34"+ + "\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36"+ + "\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3"+ + "!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#"+ + "\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&"+ + "\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3)\3)\3"+ + ")\3)\3)\3)\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3"+ + "+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3"+ + "/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62"+ + "\3\62\3\62\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\64"+ + "\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\66"+ + "\3\66\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67"+ + "\38\38\38\38\38\38\39\39\39\3:\3:\3:\3:\3:\3;\3;\3;\3;\3;\3;\3;\3;\3;"+ + "\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?"+ + "\3?\3?\3?\3@\3@\3@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B"+ + "\3B\3B\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\5D\u02d7\nD\3D\6D\u02da"+ + "\nD\rD\16D\u02db\3D\5D\u02df\nD\5D\u02e1\nD\3D\5D\u02e4\nD\3E\3E\3E\3"+ + "E\7E\u02ea\nE\fE\16E\u02ed\13E\3E\5E\u02f0\nE\3E\5E\u02f3\nE\3F\3F\7F"+ + "\u02f7\nF\fF\16F\u02fa\13F\3F\3F\7F\u02fe\nF\fF\16F\u0301\13F\3F\5F\u0304"+ + "\nF\3F\5F\u0307\nF\3G\3G\3G\3G\7G\u030d\nG\fG\16G\u0310\13G\3G\5G\u0313"+ + "\nG\3G\5G\u0316\nG\3H\3H\3H\5H\u031b\nH\3H\3H\5H\u031f\nH\3H\5H\u0322"+ + "\nH\3H\5H\u0325\nH\3H\3H\3H\5H\u032a\nH\3H\5H\u032d\nH\5H\u032f\nH\3I"+ + "\3I\3I\3I\5I\u0335\nI\3I\5I\u0338\nI\3I\3I\5I\u033c\nI\3I\3I\5I\u0340"+ + "\nI\3I\3I\5I\u0344\nI\3J\3J\3J\3J\3J\3J\3J\3J\3J\5J\u034f\nJ\3K\3K\3K"+ + "\5K\u0354\nK\3K\3K\3L\3L\3L\7L\u035b\nL\fL\16L\u035e\13L\3L\3L\3M\3M\3"+ + "M\3M\3M\7M\u0367\nM\fM\16M\u036a\13M\3M\3M\3M\7M\u036f\nM\fM\16M\u0372"+ + "\13M\3M\3M\3M\3M\3N\3N\3N\3N\3N\3O\3O\3P\3P\3Q\3Q\3R\3R\3S\3S\3T\3T\3"+ + "U\3U\3V\3V\3W\3W\3X\3X\3Y\3Y\3Z\3Z\3[\3[\3\\\3\\\3]\3]\3^\3^\3_\3_\3_"+ + "\3`\3`\3`\3a\3a\3a\3b\3b\3b\3c\3c\3c\3d\3d\3d\3e\3e\3e\3f\3f\3f\3g\3g"+ + "\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3o\3o\3o\3p\3p\3p\3q\3q\3q"+ + "\3r\3r\3r\3s\3s\3s\3t\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3w\3x\3x\3x\3x"+ + "\3y\3y\3y\3y\3y\3z\3z\3z\3{\3{\3{\3|\3|\3}\3}\3}\3}\3~\6~\u03f7\n~\r~"+ + "\16~\u03f8\3~\3~\3\177\3\177\3\177\3\177\7\177\u0401\n\177\f\177\16\177"+ + "\u0404\13\177\3\177\3\177\3\177\3\177\3\177\3\u0080\3\u0080\3\u0080\3"+ + "\u0080\7\u0080\u040f\n\u0080\f\u0080\16\u0080\u0412\13\u0080\3\u0080\3"+ + "\u0080\3\u0081\3\u0081\7\u0081\u0418\n\u0081\f\u0081\16\u0081\u041b\13"+ + "\u0081\3\u0082\3\u0082\5\u0082\u041f\n\u0082\3\u0082\3\u0082\3\u0083\3"+ + "\u0083\3\u0083\3\u0083\5\u0083\u0427\n\u0083\3\u0083\5\u0083\u042a\n\u0083"+ + "\3\u0083\3\u0083\3\u0083\6\u0083\u042f\n\u0083\r\u0083\16\u0083\u0430"+ + "\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\5\u0083\u0438\n\u0083\3\u0084"+ + "\3\u0084\3\u0084\7\u0084\u043d\n\u0084\f\u0084\16\u0084\u0440\13\u0084"+ + "\3\u0084\5\u0084\u0443\n\u0084\3\u0085\3\u0085\3\u0086\3\u0086\7\u0086"+ + "\u0449\n\u0086\f\u0086\16\u0086\u044c\13\u0086\3\u0086\5\u0086\u044f\n"+ + "\u0086\3\u0087\3\u0087\5\u0087\u0453\n\u0087\3\u0088\3\u0088\3\u0088\3"+ + "\u0088\5\u0088\u0459\n\u0088\4\u0370\u0402\2\u0089\3\3\5\4\7\5\t\6\13"+ + "\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'"+ + "\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'"+ + "M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u{?}@\177"+ + "A\u0081B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091J\u0093"+ + "K\u0095L\u0097M\u0099N\u009bO\u009dP\u009fQ\u00a1R\u00a3S\u00a5T\u00a7"+ + "U\u00a9V\u00abW\u00adX\u00afY\u00b1Z\u00b3[\u00b5\\\u00b7]\u00b9^\u00bb"+ + "_\u00bd`\u00bfa\u00c1b\u00c3c\u00c5d\u00c7e\u00c9f\u00cbg\u00cdh\u00cf"+ + "i\u00d1j\u00d3k\u00d5l\u00d7m\u00d9n\u00dbo\u00ddp\u00dfq\u00e1r\u00e3"+ + "s\u00e5t\u00e7u\u00e9v\u00ebw\u00edx\u00efy\u00f1z\u00f3{\u00f5|\u00f7"+ + "}\u00f9~\u00fb\177\u00fd\u0080\u00ff\u0081\u0101\u0082\u0103\2\u0105\2"+ + "\u0107\2\u0109\2\u010b\2\u010d\2\u010f\2\3\2\35\3\2\63;\4\2NNnn\4\2ZZ"+ + "zz\5\2\62;CHch\6\2\62;CHaach\3\2\629\4\2\629aa\4\2DDdd\3\2\62\63\4\2\62"+ + "\63aa\6\2FFHHffhh\4\2RRrr\4\2--//\6\2\f\f\17\17))^^\6\2\f\f\17\17$$^^"+ + "\4\2\13\13\"\"\4\2\f\f\17\17\5\2\13\f\16\17\"\"\4\2GGgg\n\2$$))^^ddhh"+ + "ppttvv\3\2\62\65\3\2\62;\4\2\62;aa\6\2&&C\\aac|\4\2\2\u0081\ud802\udc01"+ + "\3\2\ud802\udc01\3\2\udc02\ue001\2\u0486\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3"+ + "\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2"+ + "\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35"+ + "\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)"+ + "\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2"+ + "\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2"+ + "A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3"+ + "\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2"+ + "\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2"+ + "g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3"+ + "\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3"+ + "\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2"+ + "\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2\2\2\u008f\3\2\2\2\2\u0091"+ + "\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099\3\2\2"+ + "\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3"+ + "\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab\3\2\2"+ + "\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3\3\2\2\2\2\u00b5"+ + "\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2\2\2\u00bd\3\2\2"+ + "\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2\2\2\u00c7"+ + "\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2"+ + "\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9"+ + "\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2"+ + "\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb"+ + "\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2"+ + "\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd"+ + "\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\3\u0111\3\2\2\2\5\u011a\3\2\2"+ + "\2\7\u0121\3\2\2\2\t\u0129\3\2\2\2\13\u012f\3\2\2\2\r\u0134\3\2\2\2\17"+ + "\u0139\3\2\2\2\21\u013f\3\2\2\2\23\u0144\3\2\2\2\25\u014a\3\2\2\2\27\u0150"+ + "\3\2\2\2\31\u0159\3\2\2\2\33\u0161\3\2\2\2\35\u0164\3\2\2\2\37\u016b\3"+ + "\2\2\2!\u0170\3\2\2\2#\u0175\3\2\2\2%\u017d\3\2\2\2\'\u0183\3\2\2\2)\u018b"+ + "\3\2\2\2+\u0191\3\2\2\2-\u0195\3\2\2\2/\u0198\3\2\2\2\61\u019d\3\2\2\2"+ + "\63\u01a8\3\2\2\2\65\u01af\3\2\2\2\67\u01ba\3\2\2\29\u01be\3\2\2\2;\u01c8"+ + "\3\2\2\2=\u01cd\3\2\2\2?\u01d4\3\2\2\2A\u01d8\3\2\2\2C\u01e0\3\2\2\2E"+ + "\u01e8\3\2\2\2G\u01f2\3\2\2\2I\u01f9\3\2\2\2K\u0200\3\2\2\2M\u0206\3\2"+ + "\2\2O\u020d\3\2\2\2Q\u0216\3\2\2\2S\u021c\3\2\2\2U\u0223\3\2\2\2W\u0230"+ + "\3\2\2\2Y\u0235\3\2\2\2[\u023b\3\2\2\2]\u0242\3\2\2\2_\u024c\3\2\2\2a"+ + "\u0250\3\2\2\2c\u0255\3\2\2\2e\u025e\3\2\2\2g\u0264\3\2\2\2i\u026b\3\2"+ + "\2\2k\u0270\3\2\2\2m\u0279\3\2\2\2o\u0281\3\2\2\2q\u0287\3\2\2\2s\u028a"+ + "\3\2\2\2u\u028f\3\2\2\2w\u0298\3\2\2\2y\u029d\3\2\2\2{\u02a8\3\2\2\2}"+ + "\u02ac\3\2\2\2\177\u02b2\3\2\2\2\u0081\u02b9\3\2\2\2\u0083\u02c0\3\2\2"+ + "\2\u0085\u02c8\3\2\2\2\u0087\u02e0\3\2\2\2\u0089\u02e5\3\2\2\2\u008b\u02f4"+ + "\3\2\2\2\u008d\u0308\3\2\2\2\u008f\u032e\3\2\2\2\u0091\u0330\3\2\2\2\u0093"+ + "\u034e\3\2\2\2\u0095\u0350\3\2\2\2\u0097\u0357\3\2\2\2\u0099\u0361\3\2"+ + "\2\2\u009b\u0377\3\2\2\2\u009d\u037c\3\2\2\2\u009f\u037e\3\2\2\2\u00a1"+ + "\u0380\3\2\2\2\u00a3\u0382\3\2\2\2\u00a5\u0384\3\2\2\2\u00a7\u0386\3\2"+ + "\2\2\u00a9\u0388\3\2\2\2\u00ab\u038a\3\2\2\2\u00ad\u038c\3\2\2\2\u00af"+ + "\u038e\3\2\2\2\u00b1\u0390\3\2\2\2\u00b3\u0392\3\2\2\2\u00b5\u0394\3\2"+ + "\2\2\u00b7\u0396\3\2\2\2\u00b9\u0398\3\2\2\2\u00bb\u039a\3\2\2\2\u00bd"+ + "\u039c\3\2\2\2\u00bf\u039f\3\2\2\2\u00c1\u03a2\3\2\2\2\u00c3\u03a5\3\2"+ + "\2\2\u00c5\u03a8\3\2\2\2\u00c7\u03ab\3\2\2\2\u00c9\u03ae\3\2\2\2\u00cb"+ + "\u03b1\3\2\2\2\u00cd\u03b4\3\2\2\2\u00cf\u03b6\3\2\2\2\u00d1\u03b8\3\2"+ + "\2\2\u00d3\u03ba\3\2\2\2\u00d5\u03bc\3\2\2\2\u00d7\u03be\3\2\2\2\u00d9"+ + "\u03c0\3\2\2\2\u00db\u03c2\3\2\2\2\u00dd\u03c4\3\2\2\2\u00df\u03c7\3\2"+ + "\2\2\u00e1\u03ca\3\2\2\2\u00e3\u03cd\3\2\2\2\u00e5\u03d0\3\2\2\2\u00e7"+ + "\u03d3\3\2\2\2\u00e9\u03d6\3\2\2\2\u00eb\u03d9\3\2\2\2\u00ed\u03dc\3\2"+ + "\2\2\u00ef\u03e0\3\2\2\2\u00f1\u03e4\3\2\2\2\u00f3\u03e9\3\2\2\2\u00f5"+ + "\u03ec\3\2\2\2\u00f7\u03ef\3\2\2\2\u00f9\u03f1\3\2\2\2\u00fb\u03f6\3\2"+ + "\2\2\u00fd\u03fc\3\2\2\2\u00ff\u040a\3\2\2\2\u0101\u0415\3\2\2\2\u0103"+ + "\u041c\3\2\2\2\u0105\u0437\3\2\2\2\u0107\u0439\3\2\2\2\u0109\u0444\3\2"+ + "\2\2\u010b\u0446\3\2\2\2\u010d\u0452\3\2\2\2\u010f\u0458\3\2\2\2\u0111"+ + "\u0112\7c\2\2\u0112\u0113\7d\2\2\u0113\u0114\7u\2\2\u0114\u0115\7v\2\2"+ + "\u0115\u0116\7t\2\2\u0116\u0117\7c\2\2\u0117\u0118\7e\2\2\u0118\u0119"+ + "\7v\2\2\u0119\4\3\2\2\2\u011a\u011b\7c\2\2\u011b\u011c\7u\2\2\u011c\u011d"+ + "\7u\2\2\u011d\u011e\7g\2\2\u011e\u011f\7t\2\2\u011f\u0120\7v\2\2\u0120"+ + "\6\3\2\2\2\u0121\u0122\7d\2\2\u0122\u0123\7q\2\2\u0123\u0124\7q\2\2\u0124"+ + "\u0125\7n\2\2\u0125\u0126\7g\2\2\u0126\u0127\7c\2\2\u0127\u0128\7p\2\2"+ + "\u0128\b\3\2\2\2\u0129\u012a\7d\2\2\u012a\u012b\7t\2\2\u012b\u012c\7g"+ + "\2\2\u012c\u012d\7c\2\2\u012d\u012e\7m\2\2\u012e\n\3\2\2\2\u012f\u0130"+ + "\7d\2\2\u0130\u0131\7{\2\2\u0131\u0132\7v\2\2\u0132\u0133\7g\2\2\u0133"+ + "\f\3\2\2\2\u0134\u0135\7e\2\2\u0135\u0136\7c\2\2\u0136\u0137\7u\2\2\u0137"+ + "\u0138\7g\2\2\u0138\16\3\2\2\2\u0139\u013a\7e\2\2\u013a\u013b\7c\2\2\u013b"+ + "\u013c\7v\2\2\u013c\u013d\7e\2\2\u013d\u013e\7j\2\2\u013e\20\3\2\2\2\u013f"+ + "\u0140\7e\2\2\u0140\u0141\7j\2\2\u0141\u0142\7c\2\2\u0142\u0143\7t\2\2"+ + "\u0143\22\3\2\2\2\u0144\u0145\7e\2\2\u0145\u0146\7n\2\2\u0146\u0147\7"+ + "c\2\2\u0147\u0148\7u\2\2\u0148\u0149\7u\2\2\u0149\24\3\2\2\2\u014a\u014b"+ + "\7e\2\2\u014b\u014c\7q\2\2\u014c\u014d\7p\2\2\u014d\u014e\7u\2\2\u014e"+ + "\u014f\7v\2\2\u014f\26\3\2\2\2\u0150\u0151\7e\2\2\u0151\u0152\7q\2\2\u0152"+ + "\u0153\7p\2\2\u0153\u0154\7v\2\2\u0154\u0155\7k\2\2\u0155\u0156\7p\2\2"+ + "\u0156\u0157\7w\2\2\u0157\u0158\7g\2\2\u0158\30\3\2\2\2\u0159\u015a\7"+ + "f\2\2\u015a\u015b\7g\2\2\u015b\u015c\7h\2\2\u015c\u015d\7c\2\2\u015d\u015e"+ + "\7w\2\2\u015e\u015f\7n\2\2\u015f\u0160\7v\2\2\u0160\32\3\2\2\2\u0161\u0162"+ + "\7f\2\2\u0162\u0163\7q\2\2\u0163\34\3\2\2\2\u0164\u0165\7f\2\2\u0165\u0166"+ + "\7q\2\2\u0166\u0167\7w\2\2\u0167\u0168\7d\2\2\u0168\u0169\7n\2\2\u0169"+ + "\u016a\7g\2\2\u016a\36\3\2\2\2\u016b\u016c\7g\2\2\u016c\u016d\7n\2\2\u016d"+ + "\u016e\7u\2\2\u016e\u016f\7g\2\2\u016f \3\2\2\2\u0170\u0171\7g\2\2\u0171"+ + "\u0172\7p\2\2\u0172\u0173\7w\2\2\u0173\u0174\7o\2\2\u0174\"\3\2\2\2\u0175"+ + "\u0176\7g\2\2\u0176\u0177\7z\2\2\u0177\u0178\7v\2\2\u0178\u0179\7g\2\2"+ + "\u0179\u017a\7p\2\2\u017a\u017b\7f\2\2\u017b\u017c\7u\2\2\u017c$\3\2\2"+ + "\2\u017d\u017e\7h\2\2\u017e\u017f\7k\2\2\u017f\u0180\7p\2\2\u0180\u0181"+ + "\7c\2\2\u0181\u0182\7n\2\2\u0182&\3\2\2\2\u0183\u0184\7h\2\2\u0184\u0185"+ + "\7k\2\2\u0185\u0186\7p\2\2\u0186\u0187\7c\2\2\u0187\u0188\7n\2\2\u0188"+ + "\u0189\7n\2\2\u0189\u018a\7{\2\2\u018a(\3\2\2\2\u018b\u018c\7h\2\2\u018c"+ + "\u018d\7n\2\2\u018d\u018e\7q\2\2\u018e\u018f\7c\2\2\u018f\u0190\7v\2\2"+ + "\u0190*\3\2\2\2\u0191\u0192\7h\2\2\u0192\u0193\7q\2\2\u0193\u0194\7t\2"+ + "\2\u0194,\3\2\2\2\u0195\u0196\7k\2\2\u0196\u0197\7h\2\2\u0197.\3\2\2\2"+ + "\u0198\u0199\7i\2\2\u0199\u019a\7q\2\2\u019a\u019b\7v\2\2\u019b\u019c"+ + "\7q\2\2\u019c\60\3\2\2\2\u019d\u019e\7k\2\2\u019e\u019f\7o\2\2\u019f\u01a0"+ + "\7r\2\2\u01a0\u01a1\7n\2\2\u01a1\u01a2\7g\2\2\u01a2\u01a3\7o\2\2\u01a3"+ + "\u01a4\7g\2\2\u01a4\u01a5\7p\2\2\u01a5\u01a6\7v\2\2\u01a6\u01a7\7u\2\2"+ + "\u01a7\62\3\2\2\2\u01a8\u01a9\7k\2\2\u01a9\u01aa\7o\2\2\u01aa\u01ab\7"+ + "r\2\2\u01ab\u01ac\7q\2\2\u01ac\u01ad\7t\2\2\u01ad\u01ae\7v\2\2\u01ae\64"+ + "\3\2\2\2\u01af\u01b0\7k\2\2\u01b0\u01b1\7p\2\2\u01b1\u01b2\7u\2\2\u01b2"+ + "\u01b3\7v\2\2\u01b3\u01b4\7c\2\2\u01b4\u01b5\7p\2\2\u01b5\u01b6\7e\2\2"+ + "\u01b6\u01b7\7g\2\2\u01b7\u01b8\7q\2\2\u01b8\u01b9\7h\2\2\u01b9\66\3\2"+ + "\2\2\u01ba\u01bb\7k\2\2\u01bb\u01bc\7p\2\2\u01bc\u01bd\7v\2\2\u01bd8\3"+ + "\2\2\2\u01be\u01bf\7k\2\2\u01bf\u01c0\7p\2\2\u01c0\u01c1\7v\2\2\u01c1"+ + "\u01c2\7g\2\2\u01c2\u01c3\7t\2\2\u01c3\u01c4\7h\2\2\u01c4\u01c5\7c\2\2"+ + "\u01c5\u01c6\7e\2\2\u01c6\u01c7\7g\2\2\u01c7:\3\2\2\2\u01c8\u01c9\7n\2"+ + "\2\u01c9\u01ca\7q\2\2\u01ca\u01cb\7p\2\2\u01cb\u01cc\7i\2\2\u01cc<\3\2"+ + "\2\2\u01cd\u01ce\7p\2\2\u01ce\u01cf\7c\2\2\u01cf\u01d0\7v\2\2\u01d0\u01d1"+ + "\7k\2\2\u01d1\u01d2\7x\2\2\u01d2\u01d3\7g\2\2\u01d3>\3\2\2\2\u01d4\u01d5"+ + "\7p\2\2\u01d5\u01d6\7g\2\2\u01d6\u01d7\7y\2\2\u01d7@\3\2\2\2\u01d8\u01d9"+ + "\7r\2\2\u01d9\u01da\7c\2\2\u01da\u01db\7e\2\2\u01db\u01dc\7m\2\2\u01dc"+ + "\u01dd\7c\2\2\u01dd\u01de\7i\2\2\u01de\u01df\7g\2\2\u01dfB\3\2\2\2\u01e0"+ + "\u01e1\7r\2\2\u01e1\u01e2\7t\2\2\u01e2\u01e3\7k\2\2\u01e3\u01e4\7x\2\2"+ + "\u01e4\u01e5\7c\2\2\u01e5\u01e6\7v\2\2\u01e6\u01e7\7g\2\2\u01e7D\3\2\2"+ + "\2\u01e8\u01e9\7r\2\2\u01e9\u01ea\7t\2\2\u01ea\u01eb\7q\2\2\u01eb\u01ec"+ + "\7v\2\2\u01ec\u01ed\7g\2\2\u01ed\u01ee\7e\2\2\u01ee\u01ef\7v\2\2\u01ef"+ + "\u01f0\7g\2\2\u01f0\u01f1\7f\2\2\u01f1F\3\2\2\2\u01f2\u01f3\7r\2\2\u01f3"+ + "\u01f4\7w\2\2\u01f4\u01f5\7d\2\2\u01f5\u01f6\7n\2\2\u01f6\u01f7\7k\2\2"+ + "\u01f7\u01f8\7e\2\2\u01f8H\3\2\2\2\u01f9\u01fa\7t\2\2\u01fa\u01fb\7g\2"+ + "\2\u01fb\u01fc\7v\2\2\u01fc\u01fd\7w\2\2\u01fd\u01fe\7t\2\2\u01fe\u01ff"+ + "\7p\2\2\u01ffJ\3\2\2\2\u0200\u0201\7u\2\2\u0201\u0202\7j\2\2\u0202\u0203"+ + "\7q\2\2\u0203\u0204\7t\2\2\u0204\u0205\7v\2\2\u0205L\3\2\2\2\u0206\u0207"+ + "\7u\2\2\u0207\u0208\7v\2\2\u0208\u0209\7c\2\2\u0209\u020a\7v\2\2\u020a"+ + "\u020b\7k\2\2\u020b\u020c\7e\2\2\u020cN\3\2\2\2\u020d\u020e\7u\2\2\u020e"+ + "\u020f\7v\2\2\u020f\u0210\7t\2\2\u0210\u0211\7k\2\2\u0211\u0212\7e\2\2"+ + "\u0212\u0213\7v\2\2\u0213\u0214\7h\2\2\u0214\u0215\7r\2\2\u0215P\3\2\2"+ + "\2\u0216\u0217\7u\2\2\u0217\u0218\7w\2\2\u0218\u0219\7r\2\2\u0219\u021a"+ + "\7g\2\2\u021a\u021b\7t\2\2\u021bR\3\2\2\2\u021c\u021d\7u\2\2\u021d\u021e"+ + "\7y\2\2\u021e\u021f\7k\2\2\u021f\u0220\7v\2\2\u0220\u0221\7e\2\2\u0221"+ + "\u0222\7j\2\2\u0222T\3\2\2\2\u0223\u0224\7u\2\2\u0224\u0225\7{\2\2\u0225"+ + "\u0226\7p\2\2\u0226\u0227\7e\2\2\u0227\u0228\7j\2\2\u0228\u0229\7t\2\2"+ + "\u0229\u022a\7q\2\2\u022a\u022b\7p\2\2\u022b\u022c\7k\2\2\u022c\u022d"+ + "\7|\2\2\u022d\u022e\7g\2\2\u022e\u022f\7f\2\2\u022fV\3\2\2\2\u0230\u0231"+ + "\7v\2\2\u0231\u0232\7j\2\2\u0232\u0233\7k\2\2\u0233\u0234\7u\2\2\u0234"+ + "X\3\2\2\2\u0235\u0236\7v\2\2\u0236\u0237\7j\2\2\u0237\u0238\7t\2\2\u0238"+ + "\u0239\7q\2\2\u0239\u023a\7y\2\2\u023aZ\3\2\2\2\u023b\u023c\7v\2\2\u023c"+ + "\u023d\7j\2\2\u023d\u023e\7t\2\2\u023e\u023f\7q\2\2\u023f\u0240\7y\2\2"+ + "\u0240\u0241\7u\2\2\u0241\\\3\2\2\2\u0242\u0243\7v\2\2\u0243\u0244\7t"+ + "\2\2\u0244\u0245\7c\2\2\u0245\u0246\7p\2\2\u0246\u0247\7u\2\2\u0247\u0248"+ + "\7k\2\2\u0248\u0249\7g\2\2\u0249\u024a\7p\2\2\u024a\u024b\7v\2\2\u024b"+ + "^\3\2\2\2\u024c\u024d\7v\2\2\u024d\u024e\7t\2\2\u024e\u024f\7{\2\2\u024f"+ + "`\3\2\2\2\u0250\u0251\7x\2\2\u0251\u0252\7q\2\2\u0252\u0253\7k\2\2\u0253"+ + "\u0254\7f\2\2\u0254b\3\2\2\2\u0255\u0256\7x\2\2\u0256\u0257\7q\2\2\u0257"+ + "\u0258\7n\2\2\u0258\u0259\7c\2\2\u0259\u025a\7v\2\2\u025a\u025b\7k\2\2"+ + "\u025b\u025c\7n\2\2\u025c\u025d\7g\2\2\u025dd\3\2\2\2\u025e\u025f\7y\2"+ + "\2\u025f\u0260\7j\2\2\u0260\u0261\7k\2\2\u0261\u0262\7n\2\2\u0262\u0263"+ + "\7g\2\2\u0263f\3\2\2\2\u0264\u0265\7o\2\2\u0265\u0266\7q\2\2\u0266\u0267"+ + "\7f\2\2\u0267\u0268\7w\2\2\u0268\u0269\7n\2\2\u0269\u026a\7g\2\2\u026a"+ + "h\3\2\2\2\u026b\u026c\7q\2\2\u026c\u026d\7r\2\2\u026d\u026e\7g\2\2\u026e"+ + "\u026f\7p\2\2\u026fj\3\2\2\2\u0270\u0271\7t\2\2\u0271\u0272\7g\2\2\u0272"+ + "\u0273\7s\2\2\u0273\u0274\7w\2\2\u0274\u0275\7k\2\2\u0275\u0276\7t\2\2"+ + "\u0276\u0277\7g\2\2\u0277\u0278\7u\2\2\u0278l\3\2\2\2\u0279\u027a\7g\2"+ + "\2\u027a\u027b\7z\2\2\u027b\u027c\7r\2\2\u027c\u027d\7q\2\2\u027d\u027e"+ + "\7t\2\2\u027e\u027f\7v\2\2\u027f\u0280\7u\2\2\u0280n\3\2\2\2\u0281\u0282"+ + "\7q\2\2\u0282\u0283\7r\2\2\u0283\u0284\7g\2\2\u0284\u0285\7p\2\2\u0285"+ + "\u0286\7u\2\2\u0286p\3\2\2\2\u0287\u0288\7v\2\2\u0288\u0289\7q\2\2\u0289"+ + "r\3\2\2\2\u028a\u028b\7w\2\2\u028b\u028c\7u\2\2\u028c\u028d\7g\2\2\u028d"+ + "\u028e\7u\2\2\u028et\3\2\2\2\u028f\u0290\7r\2\2\u0290\u0291\7t\2\2\u0291"+ + "\u0292\7q\2\2\u0292\u0293\7x\2\2\u0293\u0294\7k\2\2\u0294\u0295\7f\2\2"+ + "\u0295\u0296\7g\2\2\u0296\u0297\7u\2\2\u0297v\3\2\2\2\u0298\u0299\7y\2"+ + "\2\u0299\u029a\7k\2\2\u029a\u029b\7v\2\2\u029b\u029c\7j\2\2\u029cx\3\2"+ + "\2\2\u029d\u029e\7v\2\2\u029e\u029f\7t\2\2\u029f\u02a0\7c\2\2\u02a0\u02a1"+ + "\7p\2\2\u02a1\u02a2\7u\2\2\u02a2\u02a3\7k\2\2\u02a3\u02a4\7v\2\2\u02a4"+ + "\u02a5\7k\2\2\u02a5\u02a6\7x\2\2\u02a6\u02a7\7g\2\2\u02a7z\3\2\2\2\u02a8"+ + "\u02a9\7x\2\2\u02a9\u02aa\7c\2\2\u02aa\u02ab\7t\2\2\u02ab|\3\2\2\2\u02ac"+ + "\u02ad\7{\2\2\u02ad\u02ae\7k\2\2\u02ae\u02af\7g\2\2\u02af\u02b0\7n\2\2"+ + "\u02b0\u02b1\7f\2\2\u02b1~\3\2\2\2\u02b2\u02b3\7t\2\2\u02b3\u02b4\7g\2"+ + "\2\u02b4\u02b5\7e\2\2\u02b5\u02b6\7q\2\2\u02b6\u02b7\7t\2\2\u02b7\u02b8"+ + "\7f\2\2\u02b8\u0080\3\2\2\2\u02b9\u02ba\7u\2\2\u02ba\u02bb\7g\2\2\u02bb"+ + "\u02bc\7c\2\2\u02bc\u02bd\7n\2\2\u02bd\u02be\7g\2\2\u02be\u02bf\7f\2\2"+ + "\u02bf\u0082\3\2\2\2\u02c0\u02c1\7r\2\2\u02c1\u02c2\7g\2\2\u02c2\u02c3"+ + "\7t\2\2\u02c3\u02c4\7o\2\2\u02c4\u02c5\7k\2\2\u02c5\u02c6\7v\2\2\u02c6"+ + "\u02c7\7u\2\2\u02c7\u0084\3\2\2\2\u02c8\u02c9\7p\2\2\u02c9\u02ca\7q\2"+ + "\2\u02ca\u02cb\7p\2\2\u02cb\u02cc\7/\2\2\u02cc\u02cd\7u\2\2\u02cd\u02ce"+ + "\7g\2\2\u02ce\u02cf\7c\2\2\u02cf\u02d0\7n\2\2\u02d0\u02d1\7g\2\2\u02d1"+ + "\u02d2\7f\2\2\u02d2\u0086\3\2\2\2\u02d3\u02e1\7\62\2\2\u02d4\u02de\t\2"+ + "\2\2\u02d5\u02d7\5\u010b\u0086\2\u02d6\u02d5\3\2\2\2\u02d6\u02d7\3\2\2"+ + "\2\u02d7\u02df\3\2\2\2\u02d8\u02da\7a\2\2\u02d9\u02d8\3\2\2\2\u02da\u02db"+ + "\3\2\2\2\u02db\u02d9\3\2\2\2\u02db\u02dc\3\2\2\2\u02dc\u02dd\3\2\2\2\u02dd"+ + "\u02df\5\u010b\u0086\2\u02de\u02d6\3\2\2\2\u02de\u02d9\3\2\2\2\u02df\u02e1"+ + "\3\2\2\2\u02e0\u02d3\3\2\2\2\u02e0\u02d4\3\2\2\2\u02e1\u02e3\3\2\2\2\u02e2"+ + "\u02e4\t\3\2\2\u02e3\u02e2\3\2\2\2\u02e3\u02e4\3\2\2\2\u02e4\u0088\3\2"+ + "\2\2\u02e5\u02e6\7\62\2\2\u02e6\u02e7\t\4\2\2\u02e7\u02ef\t\5\2\2\u02e8"+ + "\u02ea\t\6\2\2\u02e9\u02e8\3\2\2\2\u02ea\u02ed\3\2\2\2\u02eb\u02e9\3\2"+ + "\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ee\3\2\2\2\u02ed\u02eb\3\2\2\2\u02ee"+ + "\u02f0\t\5\2\2\u02ef\u02eb\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0\u02f2\3\2"+ + "\2\2\u02f1\u02f3\t\3\2\2\u02f2\u02f1\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3"+ + "\u008a\3\2\2\2\u02f4\u02f8\7\62\2\2\u02f5\u02f7\7a\2\2\u02f6\u02f5\3\2"+ + "\2\2\u02f7\u02fa\3\2\2\2\u02f8\u02f6\3\2\2\2\u02f8\u02f9\3\2\2\2\u02f9"+ + "\u02fb\3\2\2\2\u02fa\u02f8\3\2\2\2\u02fb\u0303\t\7\2\2\u02fc\u02fe\t\b"+ + "\2\2\u02fd\u02fc\3\2\2\2\u02fe\u0301\3\2\2\2\u02ff\u02fd\3\2\2\2\u02ff"+ + "\u0300\3\2\2\2\u0300\u0302\3\2\2\2\u0301\u02ff\3\2\2\2\u0302\u0304\t\7"+ + "\2\2\u0303\u02ff\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u0306\3\2\2\2\u0305"+ + "\u0307\t\3\2\2\u0306\u0305\3\2\2\2\u0306\u0307\3\2\2\2\u0307\u008c\3\2"+ + "\2\2\u0308\u0309\7\62\2\2\u0309\u030a\t\t\2\2\u030a\u0312\t\n\2\2\u030b"+ + "\u030d\t\13\2\2\u030c\u030b\3\2\2\2\u030d\u0310\3\2\2\2\u030e\u030c\3"+ + "\2\2\2\u030e\u030f\3\2\2\2\u030f\u0311\3\2\2\2\u0310\u030e\3\2\2\2\u0311"+ + "\u0313\t\n\2\2\u0312\u030e\3\2\2\2\u0312\u0313\3\2\2\2\u0313\u0315\3\2"+ + "\2\2\u0314\u0316\t\3\2\2\u0315\u0314\3\2\2\2\u0315\u0316\3\2\2\2\u0316"+ + "\u008e\3\2\2\2\u0317\u0318\5\u010b\u0086\2\u0318\u031a\7\60\2\2\u0319"+ + "\u031b\5\u010b\u0086\2\u031a\u0319\3\2\2\2\u031a\u031b\3\2\2\2\u031b\u031f"+ + "\3\2\2\2\u031c\u031d\7\60\2\2\u031d\u031f\5\u010b\u0086\2\u031e\u0317"+ + "\3\2\2\2\u031e\u031c\3\2\2\2\u031f\u0321\3\2\2\2\u0320\u0322\5\u0103\u0082"+ + "\2\u0321\u0320\3\2\2\2\u0321\u0322\3\2\2\2\u0322\u0324\3\2\2\2\u0323\u0325"+ + "\t\f\2\2\u0324\u0323\3\2\2\2\u0324\u0325\3\2\2\2\u0325\u032f\3\2\2\2\u0326"+ + "\u032c\5\u010b\u0086\2\u0327\u0329\5\u0103\u0082\2\u0328\u032a\t\f\2\2"+ + "\u0329\u0328\3\2\2\2\u0329\u032a\3\2\2\2\u032a\u032d\3\2\2\2\u032b\u032d"+ + "\t\f\2\2\u032c\u0327\3\2\2\2\u032c\u032b\3\2\2\2\u032d\u032f\3\2\2\2\u032e"+ + "\u031e\3\2\2\2\u032e\u0326\3\2\2\2\u032f\u0090\3\2\2\2\u0330\u0331\7\62"+ + "\2\2\u0331\u033b\t\4\2\2\u0332\u0334\5\u0107\u0084\2\u0333\u0335\7\60"+ + "\2\2\u0334\u0333\3\2\2\2\u0334\u0335\3\2\2\2\u0335\u033c\3\2\2\2\u0336"+ + "\u0338\5\u0107\u0084\2\u0337\u0336\3\2\2\2\u0337\u0338\3\2\2\2\u0338\u0339"+ + "\3\2\2\2\u0339\u033a\7\60\2\2\u033a\u033c\5\u0107\u0084\2\u033b\u0332"+ + "\3\2\2\2\u033b\u0337\3\2\2\2\u033c\u033d\3\2\2\2\u033d\u033f\t\r\2\2\u033e"+ + "\u0340\t\16\2\2\u033f\u033e\3\2\2\2\u033f\u0340\3\2\2\2\u0340\u0341\3"+ + "\2\2\2\u0341\u0343\5\u010b\u0086\2\u0342\u0344\t\f\2\2\u0343\u0342\3\2"+ + "\2\2\u0343\u0344\3\2\2\2\u0344\u0092\3\2\2\2\u0345\u0346\7v\2\2\u0346"+ + "\u0347\7t\2\2\u0347\u0348\7w\2\2\u0348\u034f\7g\2\2\u0349\u034a\7h\2\2"+ + "\u034a\u034b\7c\2\2\u034b\u034c\7n\2\2\u034c\u034d\7u\2\2\u034d\u034f"+ + "\7g\2\2\u034e\u0345\3\2\2\2\u034e\u0349\3\2\2\2\u034f\u0094\3\2\2\2\u0350"+ + "\u0353\7)\2\2\u0351\u0354\n\17\2\2\u0352\u0354\5\u0105\u0083\2\u0353\u0351"+ + "\3\2\2\2\u0353\u0352\3\2\2\2\u0354\u0355\3\2\2\2\u0355\u0356\7)\2\2\u0356"+ + "\u0096\3\2\2\2\u0357\u035c\7$\2\2\u0358\u035b\n\20\2\2\u0359\u035b\5\u0105"+ + "\u0083\2\u035a\u0358\3\2\2\2\u035a\u0359\3\2\2\2\u035b\u035e\3\2\2\2\u035c"+ + "\u035a\3\2\2\2\u035c\u035d\3\2\2\2\u035d\u035f\3\2\2\2\u035e\u035c\3\2"+ + "\2\2\u035f\u0360\7$\2\2\u0360\u0098\3\2\2\2\u0361\u0362\7$\2\2\u0362\u0363"+ + "\7$\2\2\u0363\u0364\7$\2\2\u0364\u0368\3\2\2\2\u0365\u0367\t\21\2\2\u0366"+ + "\u0365\3\2\2\2\u0367\u036a\3\2\2\2\u0368\u0366\3\2\2\2\u0368\u0369\3\2"+ + "\2\2\u0369\u036b\3\2\2\2\u036a\u0368\3\2\2\2\u036b\u0370\t\22\2\2\u036c"+ + "\u036f\13\2\2\2\u036d\u036f\5\u0105\u0083\2\u036e\u036c\3\2\2\2\u036e"+ + "\u036d\3\2\2\2\u036f\u0372\3\2\2\2\u0370\u0371\3\2\2\2\u0370\u036e\3\2"+ + "\2\2\u0371\u0373\3\2\2\2\u0372\u0370\3\2\2\2\u0373\u0374\7$\2\2\u0374"+ + "\u0375\7$\2\2\u0375\u0376\7$\2\2\u0376\u009a\3\2\2\2\u0377\u0378\7p\2"+ + "\2\u0378\u0379\7w\2\2\u0379\u037a\7n\2\2\u037a\u037b\7n\2\2\u037b\u009c"+ + "\3\2\2\2\u037c\u037d\7*\2\2\u037d\u009e\3\2\2\2\u037e\u037f\7+\2\2\u037f"+ + "\u00a0\3\2\2\2\u0380\u0381\7}\2\2\u0381\u00a2\3\2\2\2\u0382\u0383\7\177"+ + "\2\2\u0383\u00a4\3\2\2\2\u0384\u0385\7]\2\2\u0385\u00a6\3\2\2\2\u0386"+ + "\u0387\7_\2\2\u0387\u00a8\3\2\2\2\u0388\u0389\7=\2\2\u0389\u00aa\3\2\2"+ + "\2\u038a\u038b\7.\2\2\u038b\u00ac\3\2\2\2\u038c\u038d\7\60\2\2\u038d\u00ae"+ + "\3\2\2\2\u038e\u038f\7?\2\2\u038f\u00b0\3\2\2\2\u0390\u0391\7@\2\2\u0391"+ + "\u00b2\3\2\2\2\u0392\u0393\7>\2\2\u0393\u00b4\3\2\2\2\u0394\u0395\7#\2"+ + "\2\u0395\u00b6\3\2\2\2\u0396\u0397\7\u0080\2\2\u0397\u00b8\3\2\2\2\u0398"+ + "\u0399\7A\2\2\u0399\u00ba\3\2\2\2\u039a\u039b\7<\2\2\u039b\u00bc\3\2\2"+ + "\2\u039c\u039d\7?\2\2\u039d\u039e\7?\2\2\u039e\u00be\3\2\2\2\u039f\u03a0"+ + "\7>\2\2\u03a0\u03a1\7?\2\2\u03a1\u00c0\3\2\2\2\u03a2\u03a3\7@\2\2\u03a3"+ + "\u03a4\7?\2\2\u03a4\u00c2\3\2\2\2\u03a5\u03a6\7#\2\2\u03a6\u03a7\7?\2"+ + "\2\u03a7\u00c4\3\2\2\2\u03a8\u03a9\7(\2\2\u03a9\u03aa\7(\2\2\u03aa\u00c6"+ + "\3\2\2\2\u03ab\u03ac\7~\2\2\u03ac\u03ad\7~\2\2\u03ad\u00c8\3\2\2\2\u03ae"+ + "\u03af\7-\2\2\u03af\u03b0\7-\2\2\u03b0\u00ca\3\2\2\2\u03b1\u03b2\7/\2"+ + "\2\u03b2\u03b3\7/\2\2\u03b3\u00cc\3\2\2\2\u03b4\u03b5\7-\2\2\u03b5\u00ce"+ + "\3\2\2\2\u03b6\u03b7\7/\2\2\u03b7\u00d0\3\2\2\2\u03b8\u03b9\7,\2\2\u03b9"+ + "\u00d2\3\2\2\2\u03ba\u03bb\7\61\2\2\u03bb\u00d4\3\2\2\2\u03bc\u03bd\7"+ + "(\2\2\u03bd\u00d6\3\2\2\2\u03be\u03bf\7~\2\2\u03bf\u00d8\3\2\2\2\u03c0"+ + "\u03c1\7`\2\2\u03c1\u00da\3\2\2\2\u03c2\u03c3\7\'\2\2\u03c3\u00dc\3\2"+ + "\2\2\u03c4\u03c5\7-\2\2\u03c5\u03c6\7?\2\2\u03c6\u00de\3\2\2\2\u03c7\u03c8"+ + "\7/\2\2\u03c8\u03c9\7?\2\2\u03c9\u00e0\3\2\2\2\u03ca\u03cb\7,\2\2\u03cb"+ + "\u03cc\7?\2\2\u03cc\u00e2\3\2\2\2\u03cd\u03ce\7\61\2\2\u03ce\u03cf\7?"+ + "\2\2\u03cf\u00e4\3\2\2\2\u03d0\u03d1\7(\2\2\u03d1\u03d2\7?\2\2\u03d2\u00e6"+ + "\3\2\2\2\u03d3\u03d4\7~\2\2\u03d4\u03d5\7?\2\2\u03d5\u00e8\3\2\2\2\u03d6"+ + "\u03d7\7`\2\2\u03d7\u03d8\7?\2\2\u03d8\u00ea\3\2\2\2\u03d9\u03da\7\'\2"+ + "\2\u03da\u03db\7?\2\2\u03db\u00ec\3\2\2\2\u03dc\u03dd\7>\2\2\u03dd\u03de"+ + "\7>\2\2\u03de\u03df\7?\2\2\u03df\u00ee\3\2\2\2\u03e0\u03e1\7@\2\2\u03e1"+ + "\u03e2\7@\2\2\u03e2\u03e3\7?\2\2\u03e3\u00f0\3\2\2\2\u03e4\u03e5\7@\2"+ + "\2\u03e5\u03e6\7@\2\2\u03e6\u03e7\7@\2\2\u03e7\u03e8\7?\2\2\u03e8\u00f2"+ + "\3\2\2\2\u03e9\u03ea\7/\2\2\u03ea\u03eb\7@\2\2\u03eb\u00f4\3\2\2\2\u03ec"+ + "\u03ed\7<\2\2\u03ed\u03ee\7<\2\2\u03ee\u00f6\3\2\2\2\u03ef\u03f0\7B\2"+ + "\2\u03f0\u00f8\3\2\2\2\u03f1\u03f2\7\60\2\2\u03f2\u03f3\7\60\2\2\u03f3"+ + "\u03f4\7\60\2\2\u03f4\u00fa\3\2\2\2\u03f5\u03f7\t\23\2\2\u03f6\u03f5\3"+ + "\2\2\2\u03f7\u03f8\3\2\2\2\u03f8\u03f6\3\2\2\2\u03f8\u03f9\3\2\2\2\u03f9"+ + "\u03fa\3\2\2\2\u03fa\u03fb\b~\2\2\u03fb\u00fc\3\2\2\2\u03fc\u03fd\7\61"+ + "\2\2\u03fd\u03fe\7,\2\2\u03fe\u0402\3\2\2\2\u03ff\u0401\13\2\2\2\u0400"+ + "\u03ff\3\2\2\2\u0401\u0404\3\2\2\2\u0402\u0403\3\2\2\2\u0402\u0400\3\2"+ + "\2\2\u0403\u0405\3\2\2\2\u0404\u0402\3\2\2\2\u0405\u0406\7,\2\2\u0406"+ + "\u0407\7\61\2\2\u0407\u0408\3\2\2\2\u0408\u0409\b\177\2\2\u0409\u00fe"+ + "\3\2\2\2\u040a\u040b\7\61\2\2\u040b\u040c\7\61\2\2\u040c\u0410\3\2\2\2"+ + "\u040d\u040f\n\22\2\2\u040e\u040d\3\2\2\2\u040f\u0412\3\2\2\2\u0410\u040e"+ + "\3\2\2\2\u0410\u0411\3\2\2\2\u0411\u0413\3\2\2\2\u0412\u0410\3\2\2\2\u0413"+ + "\u0414\b\u0080\2\2\u0414\u0100\3\2\2\2\u0415\u0419\5\u010f\u0088\2\u0416"+ + "\u0418\5\u010d\u0087\2\u0417\u0416\3\2\2\2\u0418\u041b\3\2\2\2\u0419\u0417"+ + "\3\2\2\2\u0419\u041a\3\2\2\2\u041a\u0102\3\2\2\2\u041b\u0419\3\2\2\2\u041c"+ + "\u041e\t\24\2\2\u041d\u041f\t\16\2\2\u041e\u041d\3\2\2\2\u041e\u041f\3"+ + "\2\2\2\u041f\u0420\3\2\2\2\u0420\u0421\5\u010b\u0086\2\u0421\u0104\3\2"+ + "\2\2\u0422\u0423\7^\2\2\u0423\u0438\t\25\2\2\u0424\u0429\7^\2\2\u0425"+ + "\u0427\t\26\2\2\u0426\u0425\3\2\2\2\u0426\u0427\3\2\2\2\u0427\u0428\3"+ + "\2\2\2\u0428\u042a\t\7\2\2\u0429\u0426\3\2\2\2\u0429\u042a\3\2\2\2\u042a"+ + "\u042b\3\2\2\2\u042b\u0438\t\7\2\2\u042c\u042e\7^\2\2\u042d\u042f\7w\2"+ + "\2\u042e\u042d\3\2\2\2\u042f\u0430\3\2\2\2\u0430\u042e\3\2\2\2\u0430\u0431"+ + "\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\5\u0109\u0085\2\u0433\u0434\5"+ + "\u0109\u0085\2\u0434\u0435\5\u0109\u0085\2\u0435\u0436\5\u0109\u0085\2"+ + "\u0436\u0438\3\2\2\2\u0437\u0422\3\2\2\2\u0437\u0424\3\2\2\2\u0437\u042c"+ + "\3\2\2\2\u0438\u0106\3\2\2\2\u0439\u0442\5\u0109\u0085\2\u043a\u043d\5"+ + "\u0109\u0085\2\u043b\u043d\7a\2\2\u043c\u043a\3\2\2\2\u043c\u043b\3\2"+ + "\2\2\u043d\u0440\3\2\2\2\u043e\u043c\3\2\2\2\u043e\u043f\3\2\2\2\u043f"+ + "\u0441\3\2\2\2\u0440\u043e\3\2\2\2\u0441\u0443\5\u0109\u0085\2\u0442\u043e"+ + "\3\2\2\2\u0442\u0443\3\2\2\2\u0443\u0108\3\2\2\2\u0444\u0445\t\5\2\2\u0445"+ + "\u010a\3\2\2\2\u0446\u044e\t\27\2\2\u0447\u0449\t\30\2\2\u0448\u0447\3"+ + "\2\2\2\u0449\u044c\3\2\2\2\u044a\u0448\3\2\2\2\u044a\u044b\3\2\2\2\u044b"+ + "\u044d\3\2\2\2\u044c\u044a\3\2\2\2\u044d\u044f\t\27\2\2\u044e\u044a\3"+ + "\2\2\2\u044e\u044f\3\2\2\2\u044f\u010c\3\2\2\2\u0450\u0453\5\u010f\u0088"+ + "\2\u0451\u0453\t\27\2\2\u0452\u0450\3\2\2\2\u0452\u0451\3\2\2\2\u0453"+ + "\u010e\3\2\2\2\u0454\u0459\t\31\2\2\u0455\u0459\n\32\2\2\u0456\u0457\t"+ + "\33\2\2\u0457\u0459\t\34\2\2\u0458\u0454\3\2\2\2\u0458\u0455\3\2\2\2\u0458"+ + "\u0456\3\2\2\2\u0459\u0110\3\2\2\2\65\2\u02d6\u02db\u02de\u02e0\u02e3"+ + "\u02eb\u02ef\u02f2\u02f8\u02ff\u0303\u0306\u030e\u0312\u0315\u031a\u031e"+ + "\u0321\u0324\u0329\u032c\u032e\u0334\u0337\u033b\u033f\u0343\u034e\u0353"+ + "\u035a\u035c\u0368\u036e\u0370\u03f8\u0402\u0410\u0419\u041e\u0426\u0429"+ + "\u0430\u0437\u043c\u043e\u0442\u044a\u044e\u0452\u0458\3\2\3\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens new file mode 100644 index 00000000..f811013a --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens @@ -0,0 +1,242 @@ +ABSTRACT=1 +ASSERT=2 +BOOLEAN=3 +BREAK=4 +BYTE=5 +CASE=6 +CATCH=7 +CHAR=8 +CLASS=9 +CONST=10 +CONTINUE=11 +DEFAULT=12 +DO=13 +DOUBLE=14 +ELSE=15 +ENUM=16 +EXTENDS=17 +FINAL=18 +FINALLY=19 +FLOAT=20 +FOR=21 +IF=22 +GOTO=23 +IMPLEMENTS=24 +IMPORT=25 +INSTANCEOF=26 +INT=27 +INTERFACE=28 +LONG=29 +NATIVE=30 +NEW=31 +PACKAGE=32 +PRIVATE=33 +PROTECTED=34 +PUBLIC=35 +RETURN=36 +SHORT=37 +STATIC=38 +STRICTFP=39 +SUPER=40 +SWITCH=41 +SYNCHRONIZED=42 +THIS=43 +THROW=44 +THROWS=45 +TRANSIENT=46 +TRY=47 +VOID=48 +VOLATILE=49 +WHILE=50 +MODULE=51 +OPEN=52 +REQUIRES=53 +EXPORTS=54 +OPENS=55 +TO=56 +USES=57 +PROVIDES=58 +WITH=59 +TRANSITIVE=60 +VAR=61 +YIELD=62 +RECORD=63 +SEALED=64 +PERMITS=65 +NON_SEALED=66 +DECIMAL_LITERAL=67 +HEX_LITERAL=68 +OCT_LITERAL=69 +BINARY_LITERAL=70 +FLOAT_LITERAL=71 +HEX_FLOAT_LITERAL=72 +BOOL_LITERAL=73 +CHAR_LITERAL=74 +STRING_LITERAL=75 +TEXT_BLOCK=76 +NULL_LITERAL=77 +LPAREN=78 +RPAREN=79 +LBRACE=80 +RBRACE=81 +LBRACK=82 +RBRACK=83 +SEMI=84 +COMMA=85 +DOT=86 +ASSIGN=87 +GT=88 +LT=89 +BANG=90 +TILDE=91 +QUESTION=92 +COLON=93 +EQUAL=94 +LE=95 +GE=96 +NOTEQUAL=97 +AND=98 +OR=99 +INC=100 +DEC=101 +ADD=102 +SUB=103 +MUL=104 +DIV=105 +BITAND=106 +BITOR=107 +CARET=108 +MOD=109 +ADD_ASSIGN=110 +SUB_ASSIGN=111 +MUL_ASSIGN=112 +DIV_ASSIGN=113 +AND_ASSIGN=114 +OR_ASSIGN=115 +XOR_ASSIGN=116 +MOD_ASSIGN=117 +LSHIFT_ASSIGN=118 +RSHIFT_ASSIGN=119 +URSHIFT_ASSIGN=120 +ARROW=121 +COLONCOLON=122 +AT=123 +ELLIPSIS=124 +WS=125 +COMMENT=126 +LINE_COMMENT=127 +IDENTIFIER=128 +'abstract'=1 +'assert'=2 +'boolean'=3 +'break'=4 +'byte'=5 +'case'=6 +'catch'=7 +'char'=8 +'class'=9 +'const'=10 +'continue'=11 +'default'=12 +'do'=13 +'double'=14 +'else'=15 +'enum'=16 +'extends'=17 +'final'=18 +'finally'=19 +'float'=20 +'for'=21 +'if'=22 +'goto'=23 +'implements'=24 +'import'=25 +'instanceof'=26 +'int'=27 +'interface'=28 +'long'=29 +'native'=30 +'new'=31 +'package'=32 +'private'=33 +'protected'=34 +'public'=35 +'return'=36 +'short'=37 +'static'=38 +'strictfp'=39 +'super'=40 +'switch'=41 +'synchronized'=42 +'this'=43 +'throw'=44 +'throws'=45 +'transient'=46 +'try'=47 +'void'=48 +'volatile'=49 +'while'=50 +'module'=51 +'open'=52 +'requires'=53 +'exports'=54 +'opens'=55 +'to'=56 +'uses'=57 +'provides'=58 +'with'=59 +'transitive'=60 +'var'=61 +'yield'=62 +'record'=63 +'sealed'=64 +'permits'=65 +'non-sealed'=66 +'null'=77 +'('=78 +')'=79 +'{'=80 +'}'=81 +'['=82 +']'=83 +';'=84 +','=85 +'.'=86 +'='=87 +'>'=88 +'<'=89 +'!'=90 +'~'=91 +'?'=92 +':'=93 +'=='=94 +'<='=95 +'>='=96 +'!='=97 +'&&'=98 +'||'=99 +'++'=100 +'--'=101 +'+'=102 +'-'=103 +'*'=104 +'/'=105 +'&'=106 +'|'=107 +'^'=108 +'%'=109 +'+='=110 +'-='=111 +'*='=112 +'/='=113 +'&='=114 +'|='=115 +'^='=116 +'%='=117 +'<<='=118 +'>>='=119 +'>>>='=120 +'->'=121 +'::'=122 +'@'=123 +'...'=124 diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp new file mode 100644 index 00000000..522aeebf --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp @@ -0,0 +1,275 @@ +token literal names: +null +'abstract' +'assert' +'boolean' +'break' +'byte' +'case' +'catch' +'char' +'class' +'const' +'continue' +'default' +'do' +'double' +'else' +'enum' +'extends' +'final' +'finally' +'float' +'for' +'if' +'goto' +'implements' +'import' +'instanceof' +'int' +'interface' +'long' +'native' +'new' +'package' +'private' +'protected' +'public' +'return' +'short' +'static' +'strictfp' +'super' +'switch' +'synchronized' +'this' +'throw' +'throws' +'transient' +'try' +'void' +'volatile' +'while' +'module' +'open' +'requires' +'exports' +'opens' +'to' +'uses' +'provides' +'with' +'transitive' +'var' +'yield' +'record' +'sealed' +'permits' +'non-sealed' +null +null +null +null +null +null +null +null +null +null +'null' +'(' +')' +'{' +'}' +'[' +']' +';' +',' +'.' +'=' +'>' +'<' +'!' +'~' +'?' +':' +'==' +'<=' +'>=' +'!=' +'&&' +'||' +'++' +'--' +'+' +'-' +'*' +'/' +'&' +'|' +'^' +'%' +'+=' +'-=' +'*=' +'/=' +'&=' +'|=' +'^=' +'%=' +'<<=' +'>>=' +'>>>=' +'->' +'::' +'@' +'...' +null +null +null +null + +token symbolic names: +null +ABSTRACT +ASSERT +BOOLEAN +BREAK +BYTE +CASE +CATCH +CHAR +CLASS +CONST +CONTINUE +DEFAULT +DO +DOUBLE +ELSE +ENUM +EXTENDS +FINAL +FINALLY +FLOAT +FOR +IF +GOTO +IMPLEMENTS +IMPORT +INSTANCEOF +INT +INTERFACE +LONG +NATIVE +NEW +PACKAGE +PRIVATE +PROTECTED +PUBLIC +RETURN +SHORT +STATIC +STRICTFP +SUPER +SWITCH +SYNCHRONIZED +THIS +THROW +THROWS +TRANSIENT +TRY +VOID +VOLATILE +WHILE +MODULE +OPEN +REQUIRES +EXPORTS +OPENS +TO +USES +PROVIDES +WITH +TRANSITIVE +VAR +YIELD +RECORD +SEALED +PERMITS +NON_SEALED +DECIMAL_LITERAL +HEX_LITERAL +OCT_LITERAL +BINARY_LITERAL +FLOAT_LITERAL +HEX_FLOAT_LITERAL +BOOL_LITERAL +CHAR_LITERAL +STRING_LITERAL +TEXT_BLOCK +NULL_LITERAL +LPAREN +RPAREN +LBRACE +RBRACE +LBRACK +RBRACK +SEMI +COMMA +DOT +ASSIGN +GT +LT +BANG +TILDE +QUESTION +COLON +EQUAL +LE +GE +NOTEQUAL +AND +OR +INC +DEC +ADD +SUB +MUL +DIV +BITAND +BITOR +CARET +MOD +ADD_ASSIGN +SUB_ASSIGN +MUL_ASSIGN +DIV_ASSIGN +AND_ASSIGN +OR_ASSIGN +XOR_ASSIGN +MOD_ASSIGN +LSHIFT_ASSIGN +RSHIFT_ASSIGN +URSHIFT_ASSIGN +ARROW +COLONCOLON +AT +ELLIPSIS +WS +COMMENT +LINE_COMMENT +IDENTIFIER + +rule names: +expression +primary +methodCall +identifier +literal +integerLiteral +floatLiteral +expressionList + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 130, 148, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 42, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 80, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 89, 10, 2, 12, 2, 14, 2, 92, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 102, 10, 3, 3, 4, 3, 4, 3, 4, 5, 4, 107, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 114, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 120, 10, 4, 3, 4, 5, 4, 123, 10, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 134, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 143, 10, 9, 12, 9, 14, 9, 146, 11, 9, 3, 9, 2, 3, 2, 10, 2, 4, 6, 8, 10, 12, 14, 16, 2, 13, 3, 2, 102, 105, 3, 2, 92, 93, 4, 2, 106, 107, 111, 111, 3, 2, 104, 105, 4, 2, 90, 91, 97, 98, 4, 2, 96, 96, 99, 99, 4, 2, 89, 89, 112, 122, 3, 2, 102, 103, 4, 2, 53, 67, 130, 130, 3, 2, 69, 72, 3, 2, 73, 74, 2, 177, 2, 25, 3, 2, 2, 2, 4, 101, 3, 2, 2, 2, 6, 122, 3, 2, 2, 2, 8, 124, 3, 2, 2, 2, 10, 133, 3, 2, 2, 2, 12, 135, 3, 2, 2, 2, 14, 137, 3, 2, 2, 2, 16, 139, 3, 2, 2, 2, 18, 19, 8, 2, 1, 2, 19, 26, 5, 4, 3, 2, 20, 26, 5, 6, 4, 2, 21, 22, 9, 2, 2, 2, 22, 26, 5, 2, 2, 16, 23, 24, 9, 3, 2, 2, 24, 26, 5, 2, 2, 15, 25, 18, 3, 2, 2, 2, 25, 20, 3, 2, 2, 2, 25, 21, 3, 2, 2, 2, 25, 23, 3, 2, 2, 2, 26, 90, 3, 2, 2, 2, 27, 28, 12, 14, 2, 2, 28, 29, 9, 4, 2, 2, 29, 89, 5, 2, 2, 15, 30, 31, 12, 13, 2, 2, 31, 32, 9, 5, 2, 2, 32, 89, 5, 2, 2, 14, 33, 41, 12, 12, 2, 2, 34, 35, 7, 91, 2, 2, 35, 42, 7, 91, 2, 2, 36, 37, 7, 90, 2, 2, 37, 38, 7, 90, 2, 2, 38, 42, 7, 90, 2, 2, 39, 40, 7, 90, 2, 2, 40, 42, 7, 90, 2, 2, 41, 34, 3, 2, 2, 2, 41, 36, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 89, 5, 2, 2, 13, 44, 45, 12, 11, 2, 2, 45, 46, 9, 6, 2, 2, 46, 89, 5, 2, 2, 12, 47, 48, 12, 10, 2, 2, 48, 49, 9, 7, 2, 2, 49, 89, 5, 2, 2, 11, 50, 51, 12, 9, 2, 2, 51, 52, 7, 108, 2, 2, 52, 89, 5, 2, 2, 10, 53, 54, 12, 8, 2, 2, 54, 55, 7, 110, 2, 2, 55, 89, 5, 2, 2, 9, 56, 57, 12, 7, 2, 2, 57, 58, 7, 109, 2, 2, 58, 89, 5, 2, 2, 8, 59, 60, 12, 6, 2, 2, 60, 61, 7, 100, 2, 2, 61, 89, 5, 2, 2, 7, 62, 63, 12, 5, 2, 2, 63, 64, 7, 101, 2, 2, 64, 89, 5, 2, 2, 6, 65, 66, 12, 4, 2, 2, 66, 67, 7, 94, 2, 2, 67, 68, 5, 2, 2, 2, 68, 69, 7, 95, 2, 2, 69, 70, 5, 2, 2, 4, 70, 89, 3, 2, 2, 2, 71, 72, 12, 3, 2, 2, 72, 73, 9, 8, 2, 2, 73, 89, 5, 2, 2, 3, 74, 75, 12, 20, 2, 2, 75, 79, 7, 88, 2, 2, 76, 80, 5, 8, 5, 2, 77, 80, 5, 6, 4, 2, 78, 80, 7, 45, 2, 2, 79, 76, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 78, 3, 2, 2, 2, 80, 89, 3, 2, 2, 2, 81, 82, 12, 19, 2, 2, 82, 83, 7, 84, 2, 2, 83, 84, 5, 2, 2, 2, 84, 85, 7, 85, 2, 2, 85, 89, 3, 2, 2, 2, 86, 87, 12, 17, 2, 2, 87, 89, 9, 9, 2, 2, 88, 27, 3, 2, 2, 2, 88, 30, 3, 2, 2, 2, 88, 33, 3, 2, 2, 2, 88, 44, 3, 2, 2, 2, 88, 47, 3, 2, 2, 2, 88, 50, 3, 2, 2, 2, 88, 53, 3, 2, 2, 2, 88, 56, 3, 2, 2, 2, 88, 59, 3, 2, 2, 2, 88, 62, 3, 2, 2, 2, 88, 65, 3, 2, 2, 2, 88, 71, 3, 2, 2, 2, 88, 74, 3, 2, 2, 2, 88, 81, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 3, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 94, 7, 80, 2, 2, 94, 95, 5, 2, 2, 2, 95, 96, 7, 81, 2, 2, 96, 102, 3, 2, 2, 2, 97, 102, 7, 45, 2, 2, 98, 102, 7, 42, 2, 2, 99, 102, 5, 10, 6, 2, 100, 102, 5, 8, 5, 2, 101, 93, 3, 2, 2, 2, 101, 97, 3, 2, 2, 2, 101, 98, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 5, 3, 2, 2, 2, 103, 104, 5, 8, 5, 2, 104, 106, 7, 80, 2, 2, 105, 107, 5, 16, 9, 2, 106, 105, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 7, 81, 2, 2, 109, 123, 3, 2, 2, 2, 110, 111, 7, 45, 2, 2, 111, 113, 7, 80, 2, 2, 112, 114, 5, 16, 9, 2, 113, 112, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 123, 7, 81, 2, 2, 116, 117, 7, 42, 2, 2, 117, 119, 7, 80, 2, 2, 118, 120, 5, 16, 9, 2, 119, 118, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 123, 7, 81, 2, 2, 122, 103, 3, 2, 2, 2, 122, 110, 3, 2, 2, 2, 122, 116, 3, 2, 2, 2, 123, 7, 3, 2, 2, 2, 124, 125, 9, 10, 2, 2, 125, 9, 3, 2, 2, 2, 126, 134, 5, 12, 7, 2, 127, 134, 5, 14, 8, 2, 128, 134, 7, 76, 2, 2, 129, 134, 7, 77, 2, 2, 130, 134, 7, 75, 2, 2, 131, 134, 7, 79, 2, 2, 132, 134, 7, 78, 2, 2, 133, 126, 3, 2, 2, 2, 133, 127, 3, 2, 2, 2, 133, 128, 3, 2, 2, 2, 133, 129, 3, 2, 2, 2, 133, 130, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 132, 3, 2, 2, 2, 134, 11, 3, 2, 2, 2, 135, 136, 9, 11, 2, 2, 136, 13, 3, 2, 2, 2, 137, 138, 9, 12, 2, 2, 138, 15, 3, 2, 2, 2, 139, 144, 5, 2, 2, 2, 140, 141, 7, 87, 2, 2, 141, 143, 5, 2, 2, 2, 142, 140, 3, 2, 2, 2, 143, 146, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 17, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 14, 25, 41, 79, 88, 90, 101, 106, 113, 119, 122, 133, 144] \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens new file mode 100644 index 00000000..f811013a --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens @@ -0,0 +1,242 @@ +ABSTRACT=1 +ASSERT=2 +BOOLEAN=3 +BREAK=4 +BYTE=5 +CASE=6 +CATCH=7 +CHAR=8 +CLASS=9 +CONST=10 +CONTINUE=11 +DEFAULT=12 +DO=13 +DOUBLE=14 +ELSE=15 +ENUM=16 +EXTENDS=17 +FINAL=18 +FINALLY=19 +FLOAT=20 +FOR=21 +IF=22 +GOTO=23 +IMPLEMENTS=24 +IMPORT=25 +INSTANCEOF=26 +INT=27 +INTERFACE=28 +LONG=29 +NATIVE=30 +NEW=31 +PACKAGE=32 +PRIVATE=33 +PROTECTED=34 +PUBLIC=35 +RETURN=36 +SHORT=37 +STATIC=38 +STRICTFP=39 +SUPER=40 +SWITCH=41 +SYNCHRONIZED=42 +THIS=43 +THROW=44 +THROWS=45 +TRANSIENT=46 +TRY=47 +VOID=48 +VOLATILE=49 +WHILE=50 +MODULE=51 +OPEN=52 +REQUIRES=53 +EXPORTS=54 +OPENS=55 +TO=56 +USES=57 +PROVIDES=58 +WITH=59 +TRANSITIVE=60 +VAR=61 +YIELD=62 +RECORD=63 +SEALED=64 +PERMITS=65 +NON_SEALED=66 +DECIMAL_LITERAL=67 +HEX_LITERAL=68 +OCT_LITERAL=69 +BINARY_LITERAL=70 +FLOAT_LITERAL=71 +HEX_FLOAT_LITERAL=72 +BOOL_LITERAL=73 +CHAR_LITERAL=74 +STRING_LITERAL=75 +TEXT_BLOCK=76 +NULL_LITERAL=77 +LPAREN=78 +RPAREN=79 +LBRACE=80 +RBRACE=81 +LBRACK=82 +RBRACK=83 +SEMI=84 +COMMA=85 +DOT=86 +ASSIGN=87 +GT=88 +LT=89 +BANG=90 +TILDE=91 +QUESTION=92 +COLON=93 +EQUAL=94 +LE=95 +GE=96 +NOTEQUAL=97 +AND=98 +OR=99 +INC=100 +DEC=101 +ADD=102 +SUB=103 +MUL=104 +DIV=105 +BITAND=106 +BITOR=107 +CARET=108 +MOD=109 +ADD_ASSIGN=110 +SUB_ASSIGN=111 +MUL_ASSIGN=112 +DIV_ASSIGN=113 +AND_ASSIGN=114 +OR_ASSIGN=115 +XOR_ASSIGN=116 +MOD_ASSIGN=117 +LSHIFT_ASSIGN=118 +RSHIFT_ASSIGN=119 +URSHIFT_ASSIGN=120 +ARROW=121 +COLONCOLON=122 +AT=123 +ELLIPSIS=124 +WS=125 +COMMENT=126 +LINE_COMMENT=127 +IDENTIFIER=128 +'abstract'=1 +'assert'=2 +'boolean'=3 +'break'=4 +'byte'=5 +'case'=6 +'catch'=7 +'char'=8 +'class'=9 +'const'=10 +'continue'=11 +'default'=12 +'do'=13 +'double'=14 +'else'=15 +'enum'=16 +'extends'=17 +'final'=18 +'finally'=19 +'float'=20 +'for'=21 +'if'=22 +'goto'=23 +'implements'=24 +'import'=25 +'instanceof'=26 +'int'=27 +'interface'=28 +'long'=29 +'native'=30 +'new'=31 +'package'=32 +'private'=33 +'protected'=34 +'public'=35 +'return'=36 +'short'=37 +'static'=38 +'strictfp'=39 +'super'=40 +'switch'=41 +'synchronized'=42 +'this'=43 +'throw'=44 +'throws'=45 +'transient'=46 +'try'=47 +'void'=48 +'volatile'=49 +'while'=50 +'module'=51 +'open'=52 +'requires'=53 +'exports'=54 +'opens'=55 +'to'=56 +'uses'=57 +'provides'=58 +'with'=59 +'transitive'=60 +'var'=61 +'yield'=62 +'record'=63 +'sealed'=64 +'permits'=65 +'non-sealed'=66 +'null'=77 +'('=78 +')'=79 +'{'=80 +'}'=81 +'['=82 +']'=83 +';'=84 +','=85 +'.'=86 +'='=87 +'>'=88 +'<'=89 +'!'=90 +'~'=91 +'?'=92 +':'=93 +'=='=94 +'<='=95 +'>='=96 +'!='=97 +'&&'=98 +'||'=99 +'++'=100 +'--'=101 +'+'=102 +'-'=103 +'*'=104 +'/'=105 +'&'=106 +'|'=107 +'^'=108 +'%'=109 +'+='=110 +'-='=111 +'*='=112 +'/='=113 +'&='=114 +'|='=115 +'^='=116 +'%='=117 +'<<='=118 +'>>='=119 +'>>>='=120 +'->'=121 +'::'=122 +'@'=123 +'...'=124 diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java new file mode 100644 index 00000000..a5ff0453 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java @@ -0,0 +1,135 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link JavaParserListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +public class JavaParserBaseListener implements JavaParserListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpression(JavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpression(JavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPrimary(JavaParser.PrimaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPrimary(JavaParser.PrimaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodCall(JavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodCall(JavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifier(JavaParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifier(JavaParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteral(JavaParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteral(JavaParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFloatLiteral(JavaParser.FloatLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFloatLiteral(JavaParser.FloatLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionList(JavaParser.ExpressionListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionList(JavaParser.ExpressionListContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java new file mode 100644 index 00000000..7520a4c4 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java @@ -0,0 +1,70 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link JavaParserVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public class JavaParserBaseVisitor extends AbstractParseTreeVisitor implements JavaParserVisitor { + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpression(JavaParser.ExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPrimary(JavaParser.PrimaryContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMethodCall(JavaParser.MethodCallContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdentifier(JavaParser.IdentifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLiteral(JavaParser.LiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFloatLiteral(JavaParser.FloatLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpressionList(JavaParser.ExpressionListContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java new file mode 100644 index 00000000..b2a9fd90 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java @@ -0,0 +1,90 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link JavaParser}. + */ +public interface JavaParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + */ + void enterExpression(JavaParser.ExpressionContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + */ + void exitExpression(JavaParser.ExpressionContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + */ + void enterPrimary(JavaParser.PrimaryContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + */ + void exitPrimary(JavaParser.PrimaryContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + */ + void enterMethodCall(JavaParser.MethodCallContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + */ + void exitMethodCall(JavaParser.MethodCallContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + */ + void enterIdentifier(JavaParser.IdentifierContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + */ + void exitIdentifier(JavaParser.IdentifierContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + */ + void enterLiteral(JavaParser.LiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + */ + void exitLiteral(JavaParser.LiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + */ + void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + */ + void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + */ + void enterFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + */ + void exitFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + */ + void enterExpressionList(JavaParser.ExpressionListContext ctx); + /** + * Exit a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + */ + void exitExpressionList(JavaParser.ExpressionListContext ctx); +} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java new file mode 100644 index 00000000..8ebd85c0 --- /dev/null +++ b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java @@ -0,0 +1,61 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 +package org.javabip.verification.parser; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link JavaParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface JavaParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link JavaParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpression(JavaParser.ExpressionContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#primary}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPrimary(JavaParser.PrimaryContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#methodCall}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodCall(JavaParser.MethodCallContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#identifier}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifier(JavaParser.IdentifierContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#literal}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteral(JavaParser.LiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#integerLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#floatLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFloatLiteral(JavaParser.FloatLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaParser#expressionList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionList(JavaParser.ExpressionListContext ctx); +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java index 5fb371a2..ce5f063d 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/BitBinaryExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class BitBinaryExpression extends BinaryExpression implements ParsedJavaExpression { public BitBinaryExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ @@ -14,10 +12,4 @@ public BitBinaryExpression(ParsedJavaExpression left, ParsedJavaExpression right public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - //could be - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java index e54c18f9..4425a98a 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/BooleanExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class BooleanExpression implements Literal { @@ -18,10 +17,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return value; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - //TODO either return null or some "ErrorExpression" - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java index 1ac37dfa..154c2a1d 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/DotSeparatedExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class DotSeparatedExpression implements ParsedJavaExpression { final ParsedJavaExpression left; @@ -18,19 +16,19 @@ public String toString(){ } @Override - public Boolean accept(PJEEvaluateVisitor v) { - return null; - } + public Object accept(PJEEvaluateVisitor v) { + //basic case + if (left instanceof ThisExpression){ + return right.accept(v); + } + if (left instanceof SuperExpression){ + //TODO communicate with the parent class + } + else { + //TODO evaluate left part + } - @Override - public Number accept(PJEEvaluateNumericVisitor v) { return null; } - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java index 3a085b7d..e572f0bd 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/EqualityExpression.java @@ -1,12 +1,10 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class EqualityExpression extends BinaryExpression implements ParsedJavaExpression { public EqualityExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator){ super(left, right, separator); - //separators = new HashSet(){{add("!=");add("==");}}; } @Override @@ -29,9 +27,4 @@ public Boolean accept(PJEEvaluateVisitor v) { } } } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java index bab75a20..c84f9965 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/FloatExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class FloatExpression implements NumericLiteral { @@ -17,17 +16,6 @@ public Double accept(PJEEvaluateVisitor v) { return value.doubleValue(); } - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - public enum FloatType { FLOAT, HEX_FLOAT } public String toString(){ diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java index c33b649f..4392ef8d 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/IdentifierExpression.java @@ -1,37 +1,32 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; + +import java.lang.reflect.Field; public class IdentifierExpression implements ParsedJavaExpression, AfterDotExpression, MethodCallBase { final String identifierName; + final Field associatedField; + final Object bipComponent; - public String getIdentifierName() { - return identifierName; - } - - public IdentifierExpression(String identifierName) { + public IdentifierExpression(String identifierName, Field field, Object component) { this.identifierName = identifierName; + this.associatedField = field; + this.bipComponent = component; } - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //nothing to do here - return true; - }*/ - public String toString(){ return identifierName; } @Override - public Boolean accept(PJEEvaluateVisitor v) { - return null; - } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { + public Object accept(PJEEvaluateVisitor v) { + try { + associatedField.setAccessible(true); + return associatedField.get(bipComponent); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } return null; } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java index 74408f30..4559728c 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/IntegerExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class IntegerExpression implements NumericLiteral { @@ -17,17 +16,6 @@ public Double accept(PJEEvaluateVisitor v) { return value.doubleValue(); } - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - public enum IntegerType { DECIMAL_LITERAL, HEX_LITERAL, OCT_LITERAL, BINARY_LITERAL } public String toString(){ diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java index 3a4463ef..8a7cb94c 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/LogicalExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class LogicalExpression extends BinaryExpression implements ParsedJavaExpression { @@ -29,9 +28,4 @@ public Boolean accept(PJEEvaluateVisitor v) { } return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java index 1e7f0683..230aece8 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodCallExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; import java.util.ArrayList; @@ -50,9 +48,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodIdentifierExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodIdentifierExpression.java new file mode 100644 index 00000000..21af6a83 --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/MethodIdentifierExpression.java @@ -0,0 +1,33 @@ +package org.javabip.verification.ast; + +import org.javabip.verification.visitors.PJEEvaluateVisitor; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public class MethodIdentifierExpression implements ParsedJavaExpression, AfterDotExpression, MethodCallBase { + final String identifierName; + final Method associatedMethod; + final Object bipComponent; + + public MethodIdentifierExpression(String identifierName, Method method, Object component) { + this.identifierName = identifierName; + this.associatedMethod = method; + this.bipComponent = component; + } + + public String toString(){ + return identifierName; + } + + @Override + public Object accept(PJEEvaluateVisitor v) { + /*try { + associatedField.setAccessible(true); + return associatedField.get(bipComponent); + } catch (IllegalAccessException e) { + e.printStackTrace(); + }*/ + return null; + } +} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java index 391803c5..bcd40b27 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/NullExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class NullExpression implements Literal, ParsedJavaExpression { public String toString(){ @@ -13,9 +11,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java index b7b98bb4..b695f90f 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ParsedJavaExpression.java @@ -1,9 +1,7 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public interface ParsedJavaExpression { Object accept(PJEEvaluateVisitor v); - Number accept(PJEEvaluateNumericVisitor v); } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java index 87bf9f74..26124ded 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/PostfixExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class PostfixExpression implements UnaryExpression, ParsedJavaExpression { final ParsedJavaExpression expression; @@ -17,23 +15,8 @@ public String toString(){ return expression.toString() + postfix; } - //Set postfixes = new HashSet(){{add("-");add("+"); add("++");add("--");add("~");add("!");}}; - - //boolean inPostfixes(String postfix){return postfixes.contains(postfix);} - - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - @Override public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java index 01414a9b..1e4f46e6 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/PrefixExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class PrefixExpression implements ParsedJavaExpression { final ParsedJavaExpression expression; @@ -21,17 +19,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - //Set prefixes = new HashSet(){{add("--");add("++");}}; - //boolean inPrefixes(String prefix){return prefixes.contains(prefix);} - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java index a7449a0f..7deaf666 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ProductExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class ProductExpression extends BinaryExpression implements ParsedJavaExpression { @@ -33,9 +32,4 @@ public Double accept(PJEEvaluateVisitor v) { } return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java index b058e9d0..1519d75b 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/RelationalExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class RelationalExpression extends BinaryExpression implements ParsedJavaExpression { @@ -14,31 +13,33 @@ public Boolean accept(PJEEvaluateVisitor v) { //here we cast the result to double as a "base class" of a Number. However, if big values are expected, it should be changed to BigDecimal try { - double left = ((Number) leftExpression.accept(v)).doubleValue(); - double right = ((Number) rightExpression.accept(v)).doubleValue(); - - switch (separator) { - case ">": return left > right; - case "<": return left < right; - case ">=": return left >= right; - case "<=": return left <= right; - - default: { - //TODO raise exception - return null; + Object leftResult = leftExpression.accept(v); + Object rightResult = rightExpression.accept(v); + + if (leftResult != null && rightResult != null) { + + double left = ((Number) leftResult).doubleValue(); + double right = ((Number) rightResult).doubleValue(); + + switch (separator) { + case ">": + return left > right; + case "<": + return left < right; + case ">=": + return left >= right; + case "<=": + return left <= right; + + default: { + //TODO raise exception + return null; + } } - } + } else return false; } catch (ClassCastException e){ //TODO process exception } return null; } - - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java index e92df9af..77d5e4ca 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/StringExpression.java @@ -1,6 +1,5 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; public class StringExpression implements Literal { @@ -17,9 +16,4 @@ public String toString(){ public String accept(PJEEvaluateVisitor v) { return value; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java index b89fe6e8..950f790e 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/SumExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class SumExpression extends BinaryExpression implements ParsedJavaExpression { public SumExpression(ParsedJavaExpression left, ParsedJavaExpression right, String separator) { @@ -48,9 +46,4 @@ public Object accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java index d994f7e1..25a45b51 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/SuperExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class SuperExpression implements ParsedJavaExpression, MethodCallBase { public String toString(){ @@ -13,17 +11,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - - } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java index 44706557..88bc7068 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/TernaryExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class TernaryExpression implements ParsedJavaExpression { final ParsedJavaExpression condition; @@ -27,17 +25,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } - - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - - } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java index 93cab90a..75ae8a59 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ThisExpression.java @@ -1,22 +1,15 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; public class ThisExpression implements ParsedJavaExpression, AfterDotExpression, MethodCallBase { public String toString(){ return "this"; } - @Override public Boolean accept(PJEEvaluateVisitor v) { return null; } - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - } } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java index 223b9a7d..22b10096 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/ExpressionASTBuilder.java @@ -7,12 +7,17 @@ import org.javabip.verification.parser.JavaParser; import org.javabip.verification.parser.JavaParserBaseVisitor; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; import java.util.stream.Collectors; public class ExpressionASTBuilder extends JavaParserBaseVisitor { + Object component; + + public ExpressionASTBuilder(Object component) { + this.component = component; + } public ParsedJavaExpression build(ParseTree t) { return (ParsedJavaExpression) t.accept(this); @@ -43,7 +48,8 @@ public ParsedJavaExpression visitTerminal(TerminalNode node) { @Override public ParsedJavaExpression visitExpression(JavaParser.ExpressionContext ctx) { List children = ctx.children; - if (children == null){ + if (children == null) { + System.out.println(); //TODO exception } @@ -57,6 +63,12 @@ public ParsedJavaExpression visitExpression(JavaParser.ExpressionContext ctx) { return buildPreAndPostfixExpression(children); } case 3: { + //case: dot-separated expression + ParseTree pt = children.get(1); + if (pt instanceof TerminalNodeImpl && pt.getText().equals(".")) { + return buildDotSeparatedExpression(children); + } + //case: binary expressions return buildBinaryExpression(children); @@ -81,6 +93,17 @@ public ParsedJavaExpression visitExpression(JavaParser.ExpressionContext ctx) { //TODO throw an exception } + private ParsedJavaExpression buildDotSeparatedExpression(List children) { + ParsedJavaExpression left = build(children.get(0)); + ParsedJavaExpression right = build(children.get(2)); + if (right instanceof AfterDotExpression){ + return new DotSeparatedExpression(left, (AfterDotExpression) right); + } else { + //TODO throw exception + return null; + } + } + @Override public ParsedJavaExpression visitPrimary(JavaParser.PrimaryContext ctx) { List children = ctx.children; @@ -145,11 +168,40 @@ public ParsedJavaExpression visitMethodCall(JavaParser.MethodCallContext ctx) { public ParsedJavaExpression visitIdentifier(JavaParser.IdentifierContext ctx) { TerminalNode identifier = ctx.IDENTIFIER(); if (identifier != null) { - return new IdentifierExpression(identifier.getText()); + String identifierName = identifier.getText(); + Optional field = checkFieldExists(identifierName); + if (field.isPresent()) { + try { + return new IdentifierExpression(identifierName, field.get(), component); + } catch (Exception e) { + + } + } else { + Optional method = checkMethodExists(identifierName); + if (method.isPresent()){ + return new MethodIdentifierExpression(identifierName, method.get(), component); + } + } + //TODO exception, malformed, no assosiated field or method } return null; //TODO should throw error since we are not interested in any other terminals that identifier + + } + + private Optional checkFieldExists(String fieldName) { + try { + return Optional.of(component.getClass().getDeclaredField(fieldName)); + } catch (NoSuchFieldException e) { + //e.printStackTrace(); + return Optional.empty(); + } + } + + private Optional checkMethodExists(String methodName) { + Method[] declaredMethods = component.getClass().getDeclaredMethods(); + return Arrays.stream(declaredMethods).filter(m -> m.getName().equals(methodName)).findFirst(); } @Override @@ -267,7 +319,7 @@ private ParsedJavaExpression buildBinaryExpression(List children) { case "<": case ">": case "<=": - case "=>": { + case ">=": { return new RelationalExpression(left, right, value); } case "+": @@ -297,27 +349,27 @@ private ParsedJavaExpression buildBinaryExpression(List children) { private ParsedJavaExpression buildPreAndPostfixExpression(List children) { Utils utils = new Utils(); ParseTree partOne = children.get(0); - if (partOne instanceof TerminalNodeImpl){ //its prefix + if (partOne instanceof TerminalNodeImpl) { //its prefix String value = partOne.getText(); if (utils.inPrefixes(value)) { ParsedJavaExpression partTwo = (ParsedJavaExpression) children.get(1).accept(this); return new PrefixExpression(partTwo, value); - } else{ + } else { //TODO wrong prefix, error } } else { ParseTree partTwo = children.get(1); - if (partTwo instanceof TerminalNodeImpl) { //its postfix - String value = partTwo.getText(); - if (utils.inPostfixes(value)) { - ParsedJavaExpression partOneExpression = (ParsedJavaExpression) partOne.accept(this); - return new PrefixExpression(partOneExpression, value); - - } else { - //otherwise it is malformed - //TODO error - } + if (partTwo instanceof TerminalNodeImpl) { //its postfix + String value = partTwo.getText(); + if (utils.inPostfixes(value)) { + ParsedJavaExpression partOneExpression = (ParsedJavaExpression) partOne.accept(this); + return new PrefixExpression(partOneExpression, value); + + } else { + //otherwise it is malformed + //TODO error } + } } //TODO error diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java deleted file mode 100644 index b06dedf9..00000000 --- a/org.javabip.api/src/main/java/org/javabip/verification/visitors/PJEEvaluateNumericVisitor.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.javabip.verification.visitors; - -import org.javabip.verification.ast.*; - -public class PJEEvaluateNumericVisitor implements PJEVisitor { - public Number visit(ParsedJavaExpression e) { - return e.accept(this); - } - - public Number visit(ArrayExpression e){ - return null; - } - public Number visit(BooleanExpression e){ - return null; - } - public Number visit(BitBinaryExpression e){ - return null; - } - public Number visit(DotSeparatedExpression e){ - return null; - } - public Number visit(EqualityExpression e){ - return null; - } - public Number visit(FloatExpression e){ - return null; - } - public Number visit(IdentifierExpression e){ - return null; - } - public Number visit(IntegerExpression e){ - return null; - } - public Number visit(LogicalExpression e){ - return null; - } - public Number visit(MethodCallExpression e){ - return null; - } - public Number visit(NullExpression e){ - return null; - } - public Number visit(PostfixExpression e){ - return null; - } - public Number visit(PrefixExpression e){ - return null; - } - public Number visit(ProductExpression e){ - return null; - } - public Number visit(RelationalExpression e){ - return null; - } - public Number visit(StringExpression e){ - return null; - } - public Number visit(SumExpression e){ - return null; - } - public Number visit(SuperExpression e){ - return null; - } - public Number visit(TernaryExpression e){ - return null; - } - public Number visit(ThisExpression e){ - return null; - } -} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/FakeSpecification.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/FakeSpecification.java new file mode 100644 index 00000000..d7fa226f --- /dev/null +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/FakeSpecification.java @@ -0,0 +1,62 @@ +package org.javabip.verification.visitors.test; + +import org.javabip.annotations.Guard; + +class FakeSpecification { + Integer bet; + Integer operator; + int pot; + String secretNumber; + Boolean win; + Double[] values; + + public FakeSpecification(Integer bet, Integer operator, int pot, String secretNumber, Boolean win, Double[] values) { + this.bet = bet; + this.operator = operator; + this.pot = pot; + this.secretNumber = secretNumber; + this.win = win; + this.values = values; + } + + public Integer getBet() { + return bet; + } + + public void setBet(Integer bet) { + this.bet = bet; + } + + public Integer getOperator() { + return operator; + } + + public void setOperator(Integer operator) { + this.operator = operator; + } + + public int getPot() { + return pot; + } + + public void setPot(int pot) { + this.pot = pot; + } + + public String getSecretNumber() { + return secretNumber; + } + + public void setSecretNumber(String secretNumber) { + this.secretNumber = secretNumber; + } + + @Guard(name = "WIN") + public Boolean getWin() { + return win; + } + + public void setWin(Boolean win) { + this.win = win; + } +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java deleted file mode 100644 index 13baa39d..00000000 --- a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateNumericVisitorTest.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.javabip.verification.visitors.test; - -import org.antlr.v4.runtime.CharStreams; -import org.antlr.v4.runtime.CommonTokenStream; -import org.javabip.verification.ast.ParsedJavaExpression; -import org.javabip.verification.parser.JavaLexer; -import org.javabip.verification.parser.JavaParser; -import org.javabip.verification.visitors.ExpressionASTBuilder; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; -import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.junit.Test; - -import static org.junit.Assert.*; - -public class PJEEvaluateNumericVisitorTest { - private Number go(String test) { - JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); - JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); - JavaParser.ExpressionContext expression = parser.expression(); - ExpressionASTBuilder v = new ExpressionASTBuilder(); - ParsedJavaExpression invariantParsedExpression = v.build(expression); - - FakeInvariantImpl invariant = new FakeInvariantImpl(test, invariantParsedExpression); - Number result = invariant.evaluateNumericExpression(); - - System.out.println(result); - return result; - } - - static class FakeInvariantImpl { - - private final String expression; - - private final ParsedJavaExpression parsedExpression; - - public FakeInvariantImpl(String expression, ParsedJavaExpression invariantParsedExpression) { - this.expression =expression; - this.parsedExpression = invariantParsedExpression; - } - - public String expr() { - return expression; - } - - public String toString() { - return "Invariant=(expr = " + expr() + ")"; - } - - public Number evaluateNumericExpression() { - return parsedExpression.accept(new PJEEvaluateNumericVisitor()); - } - } - - @Test - public void testBooleanExpressionFalse(){ - go("false"); - //null - } - - @Test - public void testBooleanExpressionTrue(){ - go("true"); - //null - } - - @Test - public void testArrayExpression(){ - } - - @Test - public void testBinaryExpression () { - } - - @Test - public void testBooleanExpression(){ - } - - @Test - public void testBitBinaryExpression(){ - - } - - @Test - public void testDotSeparatedExpression(){ - - } - - @Test - public void testEqualityExpression(){ - - } - - @Test - public void testFloatExpression(){ - - } - - @Test - public void testIdentifierExpression(){ - - } - - @Test - public void testIntegerExpression(){ - - } - - @Test - public void testLogicalExpression(){ - - } - - @Test - public void testMethodCallExpression(){ - - } - - @Test - public void testNullExpression(){ - - } - - @Test - public void testPostfixExpression(){ - - } - - @Test - public void testPrefixExpression(){ - - } - - @Test - public void testProductExpression(){ - - } - - @Test - public void testRelationalExpression(){ - - } - - @Test - public void testStringExpression(){ - - } - - @Test - public void testSumExpression(){ - - } - - @Test - public void testSuperExpression(){ - - } - - @Test - public void testTernaryExpression(){ - - } - - @Test - public void testThisExpression(){ - - } -} diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java index a4f1440e..40626681 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/PJEEvaluateVisitorTest.java @@ -2,7 +2,6 @@ import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; -import org.javabip.annotations.*; import org.javabip.verification.ast.*; import org.javabip.verification.parser.JavaLexer; import org.javabip.verification.parser.JavaParser; @@ -10,8 +9,6 @@ import org.javabip.verification.visitors.PJEEvaluateVisitor; import org.junit.Test; -import java.util.ArrayList; - import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -20,7 +17,8 @@ private boolean go(String test) { JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); JavaParser.ExpressionContext expression = parser.expression(); - ExpressionASTBuilder v = new ExpressionASTBuilder(); + FakeSpecification f = new FakeSpecification(2,1,1,"1", true, new Double[]{1.0, 2.0}); + ExpressionASTBuilder v = new ExpressionASTBuilder(f); ParsedJavaExpression invariantParsedExpression = v.build(expression); FakeInvariantImpl invariant = new FakeInvariantImpl(test, invariantParsedExpression); @@ -50,66 +48,6 @@ public String toString() { public Boolean evaluateInvariant() { return (Boolean) parsedExpression.accept(new PJEEvaluateVisitor()); } - - public Boolean evaluateInvariant(Class componentClass, Object bipComponent) { - return (Boolean) parsedExpression.accept(new PJEEvaluateVisitor()); - } - } - - static class FakeSpecification { - Float bet; - Integer operator; - int pot; - String secretNumber; - Boolean win; - - public FakeSpecification(Float bet, Integer operator, int pot, String secretNumber, Boolean win) { - this.bet = bet; - this.operator = operator; - this.pot = pot; - this.secretNumber = secretNumber; - this.win = win; - } - - public Float getBet() { - return bet; - } - - public void setBet(Float bet) { - this.bet = bet; - } - - public Integer getOperator() { - return operator; - } - - public void setOperator(Integer operator) { - this.operator = operator; - } - - public int getPot() { - return pot; - } - - public void setPot(int pot) { - this.pot = pot; - } - - public String getSecretNumber() { - return secretNumber; - } - - public void setSecretNumber(String secretNumber) { - this.secretNumber = secretNumber; - } - - public Boolean getWin() { - return win; - } - - public void setWin(Boolean win) { - this.win = win; - } } //region Basic Types Tests @@ -199,6 +137,8 @@ public void testBitBinaryExpression() { /*TODO to be implemented*/ } //region Field Accessing Tests @Test public void testIdentifierExpression() { + String test = "bet == 1"; + assertFalse(go(test)); } @Test @@ -209,30 +149,30 @@ public void testSuperExpression() { @Test public void testThisExpression() { - //TODO // in fact "this.value" is just a syntactic sugar for "value" - String test = "this.value"; - assertFalse(go(test)); + String test = "this.win"; + assertTrue(go(test)); } @Test public void testMethodCallExpression() { - } - - @Test - public void testDotSeparatedExpression() { + String test = "this.win"; + assertTrue(go(test)); } @Test public void testArrayExpression() { + //TODO } @Test public void testPostfixExpression() { + // Not supported } @Test public void testPrefixExpression() { + // Not supported } //endregion } diff --git a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java index 6a3a3f78..a88da10f 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/visitors/test/ParsedJavaExpressionASTBuilderTest.java @@ -15,7 +15,8 @@ private String go(String test) { JavaLexer lexer = new JavaLexer(CharStreams.fromString(test)); JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); JavaParser.ExpressionContext expression = parser.expression(); - ExpressionASTBuilder v = new ExpressionASTBuilder(); + FakeSpecification f = new FakeSpecification(1,1,1, "1", true, new Double[]{1.0, 2.0}); + ExpressionASTBuilder v = new ExpressionASTBuilder(f); ParsedJavaExpression result = v.build(expression); System.out.println(result); return result.toString(); @@ -62,7 +63,7 @@ public void testLiteralDouble(){ @Test public void testLiteralFloat(){ - String test = "1.0f"; + String test = "1.0"; assertEquals(go(test), test); } @@ -113,13 +114,13 @@ public void testPrimaryParentheses(){ @Test public void testIdentifier(){ - String test = "idName"; + String test = "bet"; assertEquals(go(test), test); } @Test public void testMethodId(){ - String test = "go()"; + String test = "getWin()"; assertEquals(go(test), test); } @@ -135,11 +136,11 @@ public void testMethodSuper(){ assertEquals(go(test), test); } - @Test + /*@Test public void testMethodWithArguments(){ String test = "go(true, 1)"; assertEquals(go(test), test); - } + }*/ @Test public void testArray(){ @@ -149,7 +150,7 @@ public void testArray(){ @Test public void testPostfix(){ - String test = "count++"; + String test = "bet++"; assertEquals(go(test), test); } @@ -161,19 +162,19 @@ public void testPrefix(){ @Test public void testSum(){ - String test = "1+a"; + String test = "1+bet"; assertEquals(go(test), test); } @Test public void tesProduct(){ - String test = "this.count * go(true)"; + String test = "this.bet*this.pot"; assertEquals(go(test), test); } @Test public void tesEq(){ - String test = "a==b"; + String test = "win==true"; assertEquals(go(test), test); } @@ -185,19 +186,19 @@ public void tesNeq(){ @Test public void tesDot(){ - String test = "this.count().size"; + String test = "this.win"; assertEquals(go(test), test); } @Test public void tesRel(){ - String test = "a>b"; + String test = "pot>bet"; assertEquals(go(test), test); } @Test public void tesLogic(){ - String test = "a||b"; + String test = "win||win"; assertEquals(go(test), test); } } From b919be29b8fe45f9e8aabd7c94937d2c2fc3831d Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 17:52:28 +0200 Subject: [PATCH 16/19] evaluating invariant in runtime, draft --- .../org/javabip/api/ExecutableBehaviour.java | 13 +- .../main/java/org/javabip/api/Invariant.java | 4 +- .../java/org/javabip/api/StatePredicate.java | 2 +- .../verification/ast/ArrayExpression.java | 14 - org.javabip.executor/pom.xml | 20 +- .../javabip/executor/BehaviourBuilder.java | 729 +++++---- .../org/javabip/executor/BehaviourImpl.java | 1433 +++++++++-------- .../org/javabip/executor/ExecutorKernel.java | 58 +- .../org/javabip/executor/InvariantImpl.java | 31 +- .../javabip/executor/ReflectionHelper.java | 8 +- .../javabip/executor/SpecificationParser.java | 29 +- .../org/javabip/executor/TransitionImpl.java | 16 +- 12 files changed, 1269 insertions(+), 1088 deletions(-) diff --git a/org.javabip.api/src/main/java/org/javabip/api/ExecutableBehaviour.java b/org.javabip.api/src/main/java/org/javabip/api/ExecutableBehaviour.java index 667cd646..7ace922c 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/ExecutableBehaviour.java +++ b/org.javabip.api/src/main/java/org/javabip/api/ExecutableBehaviour.java @@ -20,14 +20,15 @@ package org.javabip.api; +import javafx.util.Pair; +import org.javabip.exceptions.BIPException; + import java.lang.invoke.MethodHandle; import java.lang.reflect.InvocationTargetException; import java.util.List; import java.util.Map; import java.util.Set; -import org.javabip.exceptions.BIPException; - /** * It provides an executable behavior that makes it possible to execute transitions within the behavior. */ @@ -171,4 +172,10 @@ public boolean existInCurrentStateAndEnabledEnforceableWithoutData(Map computeGuardsWithoutData(String currentState); -} + + Pair checkInvariant() throws BIPException; + + Pair checkTransitionCondition(Object transition, Boolean pre); + + Pair checkStatePredicate(String currentState); +} \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/api/Invariant.java b/org.javabip.api/src/main/java/org/javabip/api/Invariant.java index dd22828d..11502d24 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/Invariant.java +++ b/org.javabip.api/src/main/java/org/javabip/api/Invariant.java @@ -28,7 +28,7 @@ public interface Invariant { /** * @return the invariant expression */ - public String expr(); + String expression(); - public boolean evaluateInvariant(); + boolean evaluateInvariant(Class componentClass, Object bipComponent); } \ No newline at end of file diff --git a/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java b/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java index ba836e3f..0b4ffb55 100644 --- a/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java +++ b/org.javabip.api/src/main/java/org/javabip/api/StatePredicate.java @@ -28,7 +28,7 @@ public interface StatePredicate { /** * @return the name of the predicate */ - public String name(); + public String state(); /** * @return the expression diff --git a/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java b/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java index f0f0d821..0a64d0e3 100644 --- a/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java +++ b/org.javabip.api/src/main/java/org/javabip/verification/ast/ArrayExpression.java @@ -1,8 +1,6 @@ package org.javabip.verification.ast; -import org.javabip.verification.visitors.PJEEvaluateNumericVisitor; import org.javabip.verification.visitors.PJEEvaluateVisitor; -import org.javabip.verification.visitors.PJEVisitor; // for expressions like expression[expression] public class ArrayExpression implements ParsedJavaExpression { @@ -14,12 +12,6 @@ public ArrayExpression(ParsedJavaExpression array, ParsedJavaExpression value) { this.innerExpression = value; } - /*@Override - public boolean evaluate(Class componentClass, Object bipComponent) throws Exception { - //TODO not implemented - return false; - }*/ - public String toString(){ return outerExpression.toString() + "[" + innerExpression.toString() + "]"; } @@ -28,10 +20,4 @@ public String toString(){ public Boolean accept(PJEEvaluateVisitor v) { return null; } - - @Override - public Number accept(PJEEvaluateNumericVisitor v) { - return null; - //could be: a[i] - } } diff --git a/org.javabip.executor/pom.xml b/org.javabip.executor/pom.xml index 8e77c5f8..e56bbbaf 100644 --- a/org.javabip.executor/pom.xml +++ b/org.javabip.executor/pom.xml @@ -69,6 +69,22 @@ 2.3.1 compile + + org.antlr + antlr4-runtime + 4.8-1 + + + org.openjfx + javafx-base + mac + compile + + + org.openjfx + javafx-base + 17-ea+11 + @@ -125,8 +141,8 @@ org.apache.maven.plugins maven-compiler-plugin - 8 - 8 + 11 + 11 diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java index ff066298..af157737 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourBuilder.java @@ -1,13 +1,13 @@ /* * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland * Copyright 2012-2016 Crossing-Tech SA, Switzerland - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,8 +18,14 @@ */ package org.javabip.executor; +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; import org.javabip.api.*; import org.javabip.exceptions.BIPException; +import org.javabip.verification.ast.ParsedJavaExpression; +import org.javabip.verification.parser.JavaLexer; +import org.javabip.verification.parser.JavaParser; +import org.javabip.verification.visitors.ExpressionASTBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,372 +40,363 @@ /** * Gathers all the information to build the behaviour for a BIP component. There are two ways to build it: with data and * without data. - * + * * @author Alina Zolotukhina - * */ public class BehaviourBuilder { - private Logger logger = LoggerFactory.getLogger(BehaviourBuilder.class); - - public String componentType; - public String currentState; - private ArrayList allTransitions; - private Hashtable allPorts; - private HashSet states; - private Hashtable guards; - private Object component; - - private Hashtable dataOutName; - private ArrayList> dataOut; - - public BehaviourBuilder(Object component) { - this.component = component; - allTransitions = new ArrayList(); - allPorts = new Hashtable(); - states = new HashSet(); - guards = new Hashtable(); - dataOutName = new Hashtable(); - dataOut = new ArrayList>(); - } - - /** - * Builds the behaviour basing on previously collected information. - * - * @param provider - * the component provided for the ports - * @return a new behaviour instance - * @throws BIPException - */ - public ExecutableBehaviour build(ComponentProvider provider) throws BIPException { - - if (componentType == null || componentType.isEmpty()) { - throw new NullPointerException("Component type for object " + component + " cannot be null or empty."); - } - if (currentState == null || currentState.isEmpty()) { - throw new NullPointerException("The initial state of the component of type " + componentType - + " cannot be null or empty."); - } - if (allTransitions == null || allTransitions.isEmpty()) { - throw new BIPException("List of transitions in component of type " + componentType - + " cannot be null or empty."); - } - if (states == null || states.isEmpty()) { - throw new BIPException("List of states in component of type " + componentType + " cannot be null or empty."); - } - if (allPorts == null || allPorts.isEmpty()) { - throw new BIPException("List of states in component of type " + componentType + " cannot be null or empty."); - } - if (component == null) { - throw new NullPointerException("The component object of type " + componentType + " cannot be null."); - } - - ArrayList componentPorts = new ArrayList(); - // We need to create new ports here as there was no provider information available when the specification was - // parsed. - for (Port port : this.allPorts.values()) { - componentPorts.add(new PortImpl(port.getId(), port.getType(), port.getSpecType(), provider)); - } - - Map allEnforceablePorts = new HashMap(); - for (Port port : componentPorts) { - if (port.getType().equals(PortType.enforceable)) - allEnforceablePorts.put(port.getId(), port); - } - - for (DataOutImpl data : dataOut) { - data.computeAllowedPort(allEnforceablePorts); - } - - return new BehaviourImpl(componentType, currentState, transformIntoExecutableTransition(), componentPorts, - states, guards.values(), dataOut, dataOutName, component); - } - - private ArrayList transformIntoExecutableTransition() { - - HashMap mapIdToPort = new HashMap(); - for (Port port : allPorts.values()) - mapIdToPort.put(port.getId(), port); - - // Transform transitions into ExecutableTransitions. - ArrayList transformedAllTransitions = new ArrayList(); - for (TransitionImpl transition : allTransitions) { - - // TODO DESIGN, what are exactly different ways of specifying that the port is internal. We need to be - // specific about it in spec. - if (transition.name().equals("")) { - transformedAllTransitions.add(new ExecutableTransitionImpl(transition, PortType.internal, guards)); - continue; - } - - PortType transitionPortType = mapIdToPort.get(transition.name()).getType(); - - transformedAllTransitions.add(new ExecutableTransitionImpl(transition, transitionPortType, guards)); - } - - return transformedAllTransitions; - - } - - /** - * Sets the BIP component type - * - * @param type - * the type of the component - */ - public void setComponentType(String type) { - this.componentType = type; - } - - /** - * Sets the initial state of the component. - * - * @param state - * the initial state - */ - public void setInitialState(String state) { - this.currentState = state; - states.add(state); - } - - /** - * Adds a new port. - * - * @param id - * the port name - * @param type - * the port type (enforceable or spontaneous) - * @param specificationType - * the component type to which the port belongs - */ - public void addPort(String id, PortType type, Class specificationType) { - Port port = new PortImpl(id, type, specificationType); - // PortImpl constructor already protects against null id. - if (allPorts.containsKey(id)) - throw new BIPException("Port with id " + id + " has been already defined."); - allPorts.put(id, port); - } - - /** - * Adds a new port. - * - * @param id - * the port name - * @param type - * the port type (enforceable or spontaneous) - * @param specType - * the component type to which the port belongs - */ - public void addPort(String id, PortType type, String specType) { - Port port = new PortImpl(id, type, specType); - // PortImpl constructor already protects against null id. - if (allPorts.containsKey(id)) - throw new BIPException("Port with id " + id + " has been already defined."); - allPorts.put(id, port); - } - - /** - * Adds a new state. - * - * @param state - * the state to add - */ - public void addState(String state) { - states.add(state); + private Logger logger = LoggerFactory.getLogger(BehaviourBuilder.class); + + public String componentType; + public String currentState; + private ArrayList allTransitions; + private Hashtable allPorts; + private HashSet states; + private Hashtable guards; + private Object component; + + private Hashtable dataOutName; + private ArrayList> dataOut; + + //verification annotations + private InvariantImpl invariant; + private HashMap transitionToPreConditionMap = new HashMap<>(); + private HashMap transitionToPostConditionMap = new HashMap<>(); + private HashMap stateToPredicateMap = new HashMap<>(); + + + public BehaviourBuilder(Object component) { + this.component = component; + allTransitions = new ArrayList(); + allPorts = new Hashtable(); + states = new HashSet(); + guards = new Hashtable(); + dataOutName = new Hashtable(); + dataOut = new ArrayList>(); + } + + /** + * Builds the behaviour basing on previously collected information. + * + * @param provider the component provided for the ports + * @return a new behaviour instance + * @throws BIPException + */ + public ExecutableBehaviour build(ComponentProvider provider) throws BIPException { + if (componentType == null || componentType.isEmpty()) { + throw new NullPointerException("Component type for object " + component + " cannot be null or empty."); + } + if (currentState == null || currentState.isEmpty()) { + throw new NullPointerException("The initial state of the component of type " + componentType + + " cannot be null or empty."); + } + if (allTransitions == null || allTransitions.isEmpty()) { + throw new BIPException("List of transitions in component of type " + componentType + + " cannot be null or empty."); + } + if (states == null || states.isEmpty()) { + throw new BIPException("List of states in component of type " + componentType + " cannot be null or empty."); + } + if (allPorts == null || allPorts.isEmpty()) { + throw new BIPException("List of states in component of type " + componentType + " cannot be null or empty."); + } + if (component == null) { + throw new NullPointerException("The component object of type " + componentType + " cannot be null."); + } + + ArrayList componentPorts = new ArrayList(); + // We need to create new ports here as there was no provider information available when the specification was + // parsed. + for (Port port : this.allPorts.values()) { + componentPorts.add(new PortImpl(port.getId(), port.getType(), port.getSpecType(), provider)); + } + + Map allEnforceablePorts = new HashMap(); + for (Port port : componentPorts) { + if (port.getType().equals(PortType.enforceable)) + allEnforceablePorts.put(port.getId(), port); + } + + for (DataOutImpl data : dataOut) { + data.computeAllowedPort(allEnforceablePorts); + } + + return new BehaviourImpl(componentType, currentState, transformIntoExecutableTransition(), componentPorts, + states, guards.values(), dataOut, dataOutName, component, invariant, transitionToPreConditionMap, transitionToPostConditionMap, stateToPredicateMap); + } + + private ArrayList transformIntoExecutableTransition() { + + HashMap mapIdToPort = new HashMap(); + for (Port port : allPorts.values()) + mapIdToPort.put(port.getId(), port); + + // Transform transitions into ExecutableTransitions. + ArrayList transformedAllTransitions = new ArrayList(); + for (TransitionImpl transition : allTransitions) { + + // TODO DESIGN, what are exactly different ways of specifying that the port is internal. We need to be + // specific about it in spec. + if (transition.name().equals("")) { + transformedAllTransitions.add(new ExecutableTransitionImpl(transition, PortType.internal, guards)); + continue; + } + + PortType transitionPortType = mapIdToPort.get(transition.name()).getType(); + + transformedAllTransitions.add(new ExecutableTransitionImpl(transition, transitionPortType, guards)); + } + + return transformedAllTransitions; + + } + + /** + * Sets the BIP component type + * + * @param type the type of the component + */ + public void setComponentType(String type) { + this.componentType = type; + } + + /** + * Sets the initial state of the component. + * + * @param state the initial state + */ + public void setInitialState(String state) { + this.currentState = state; + states.add(state); + } + + /** + * Adds a new port. + * + * @param id the port name + * @param type the port type (enforceable or spontaneous) + * @param specificationType the component type to which the port belongs + */ + public void addPort(String id, PortType type, Class specificationType) { + Port port = new PortImpl(id, type, specificationType); + // PortImpl constructor already protects against null id. + if (allPorts.containsKey(id)) + throw new BIPException("Port with id " + id + " has been already defined."); + allPorts.put(id, port); + } + + /** + * Adds a new port. + * + * @param id the port name + * @param type the port type (enforceable or spontaneous) + * @param specType the component type to which the port belongs + */ + public void addPort(String id, PortType type, String specType) { + Port port = new PortImpl(id, type, specType); + // PortImpl constructor already protects against null id. + if (allPorts.containsKey(id)) + throw new BIPException("Port with id " + id + " has been already defined."); + allPorts.put(id, port); + } + + /** + * Adds a new state. + * + * @param state the state to add + */ + public void addState(String state) { + states.add(state); + } + + /** + * Adds a transition without data and its source and target states. + * + * @param name transition name + * @param source source state + * @param target target state + * @param guard the guard expression + * @param pre + * @param post + * @param method + */ + public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method) { + + addTransitionAndStates(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); + + } + + /** + * Adds a transition requiring data and its source and target states. + * + * @param name transition name + * @param source source state + * @param target target state + * @param guard the guard expression + * @param method the method representing the transition + * @param data the list of data required by the transition + */ + public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method, + List> data) { + + if (!allPorts.containsKey(name)) { + if (name == null) + throw new BIPException( + "Transition name can not be null, use empty empty string for internal transitions"); + if (!name.isEmpty()) + throw new BIPException("In component " + this.componentType + " transition " + name + + " does not correspond to any port. Specify ports first and/or make sure the names match. "); + } + + addState(source); + addState(target); + + TransitionImpl transition = new TransitionImpl(name, source, target, guard, pre, post, method, data); + allTransitions.add(transition); + if (pre != null && !pre.equals("")) + transitionToPreConditionMap.put(transition, buildTransitionCondition(pre)); + + if (post != null && !post.equals("")) + transitionToPostConditionMap.put(transition, buildTransitionCondition(post)); + } + + /** + * Allows to add a new transition which does not require data. + * + * @param name transition name + * @param source source state + * @param target target state + * @param guard the guard expression + * @param method the method representing the transition + */ + public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method) { + addTransition(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); + } + + /** + * Allows to add a new transition which requires data. + * + * @param name transition name + * @param source source state + * @param target target state + * @param guard the guard expression + * @param method the method representing the transition + * @param data the list of data required by the transition + */ + public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method, List> data) { + + if (!allPorts.containsKey(name)) { + if (name == null) + throw new BIPException( + "Transition name can not be null, use empty empty string for internal transitions"); + if (!name.isEmpty()) + throw new BIPException("Transition " + name + + " does not correspond to any port. Specify ports first and/or make sure the names match. "); + } + + if (!states.contains(source)) + throw new BIPException("Transition " + name + " is specifying source state " + source + + " that has not been explicitly stated before."); + + if (!states.contains(target)) + throw new BIPException("Transition " + name + " is specifying target state " + target + + " that has not been explicitly stated before."); + + allTransitions.add(new TransitionImpl(name, source, target, guard, pre, post, method, data)); + } + + /** + * It adds a guard based on the provided method with the guard name equal to method name. + * + * @param method the method the guard represents + */ + public void addGuard(Method method) { + addGuard(method.getName(), method); + } + + /** + * It adds the guard by providing directly the method parameter. The method parameter needs to be annotated to + * convey information about the data required by the method. + *

+ * This function is left for the user convenience so the annotations can still be used to specify data. + * + * @param name name of the guard + * @param method the method that is invoked to compute given guard + */ + public void addGuard(String name, Method method) { + addGuard(name, method, ReflectionHelper.parseDataAnnotations(method)); + } + + /** + * Allows to add a new guard + * + * @param name the name of the guard + * @param method the method the guard represents + * @param data the list of data required for the guard to be computed + */ + public void addGuard(String name, Method method, List> data) { + guards.put(name, new GuardImpl(name, method, data)); + } + + /** + * Allows to add a new output data given the method providing it. This function can be called by a class which + * creates its own executable behaviour. + * + * @param method an annotated method providing the output data + */ + public void addDataOut(Method method) { + + DataOutImpl data = ReflectionHelper.parseReturnDataAnnotation(method); + dataOut.add(data); + dataOutName.put(data.name(), getMethodHandleFromMethod(method)); + } + + /** + * Allows to add a new output data given the method providing it and its annotation. + * + * @param method the method providing the data + * @param annotation the data annotation + */ + public void addDataOut(Method method, org.javabip.annotations.Data annotation) { + + DataOutImpl data = ReflectionHelper.parseReturnDataAnnotation(method, annotation); + dataOut.add(data); + dataOutName.put(data.name(), getMethodHandleFromMethod(method)); + + } + + private MethodHandle getMethodHandleFromMethod(Method method) { + MethodType methodType; + MethodHandle methodHandle = null; + MethodHandles.Lookup lookup = MethodHandles.lookup(); + methodType = MethodType.methodType(method.getReturnType(), method.getParameterTypes()); + try { + methodHandle = lookup.findVirtual(component.getClass(), method.getName(), methodType); + } catch (NoSuchMethodException e) { + ExceptionHelper.printExceptionTrace(logger, e, "When building behaviour for component " + componentType); + } catch (IllegalAccessException e) { + ExceptionHelper.printExceptionTrace(logger, e, "When building behaviour for component " + componentType); + } + return methodHandle; + } + + public void buildInvariant(String invariant) { + this.invariant = new InvariantImpl(invariant, buildPredicate(invariant), component); + } + + public InvariantImpl buildTransitionCondition(String condition) { + return new InvariantImpl(condition, buildPredicate(condition), component); + } + + public void buildStatePredicate(String condition, String currentState) { + stateToPredicateMap.put(currentState, new InvariantImpl(condition, buildPredicate(condition), component)); + } + + public ParsedJavaExpression buildPredicate(String expression){ + JavaLexer lexer = new JavaLexer(CharStreams.fromString(expression)); + JavaParser parser = new JavaParser(new CommonTokenStream(lexer)); + JavaParser.ExpressionContext invariantExpression = parser.expression(); + ExpressionASTBuilder astBuilder = new ExpressionASTBuilder(component); + return astBuilder.build(invariantExpression); } - - /** - * Adds a transition without data and its source and target states. - * @param name - * transition name - * @param source - * source state - * @param target - * target state - * @param guard -* the guard expression - * @param pre - * @param post - * @param method - */ - public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method) { - - addTransitionAndStates(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); - - } - - /** - * Adds a transition requiring data and its source and target states. - * - * @param name - * transition name - * @param source - * source state - * @param target - * target state - * @param guard - * the guard expression - * @param method - * the method representing the transition - * @param data - * the list of data required by the transition - */ - public void addTransitionAndStates(String name, String source, String target, String guard, String pre, String post, Method method, - List> data) { - - if (!allPorts.containsKey(name)) { - if (name == null) - throw new BIPException( - "Transition name can not be null, use empty empty string for internal transitions"); - if (!name.isEmpty()) - throw new BIPException("In component " + this.componentType + " transition " + name - + " does not correspond to any port. Specify ports first and/or make sure the names match. "); - } - - addState(source); - addState(target); - - allTransitions.add(new TransitionImpl(name, source, target, guard, pre, post, method, data)); - } - - /** - * Allows to add a new transition which does not require data. - * - * @param name - * transition name - * @param source - * source state - * @param target - * target state - * @param guard - * the guard expression - * @param method - * the method representing the transition - */ - public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method) { - addTransition(name, source, target, guard, pre, post, method, ReflectionHelper.parseDataAnnotations(method)); - } - - /** - * Allows to add a new transition which requires data. - * - * @param name - * transition name - * @param source - * source state - * @param target - * target state - * @param guard - * the guard expression - * @param method - * the method representing the transition - * @param data - * the list of data required by the transition - */ - public void addTransition(String name, String source, String target, String guard, String pre, String post, Method method, List> data) { - - if (!allPorts.containsKey(name)) { - if (name == null) - throw new BIPException( - "Transition name can not be null, use empty empty string for internal transitions"); - if (!name.isEmpty()) - throw new BIPException("Transition " + name - + " does not correspond to any port. Specify ports first and/or make sure the names match. "); - } - - if (!states.contains(source)) - throw new BIPException("Transition " + name + " is specifying source state " + source - + " that has not been explicitly stated before."); - - if (!states.contains(target)) - throw new BIPException("Transition " + name + " is specifying target state " + target - + " that has not been explicitly stated before."); - - allTransitions.add(new TransitionImpl(name, source, target, guard, pre, post, method, data)); - } - - /** - * It adds a guard based on the provided method with the guard name equal to method name. - * - * @param method - * the method the guard represents - */ - public void addGuard(Method method) { - addGuard(method.getName(), method); - } - - /** - * It adds the guard by providing directly the method parameter. The method parameter needs to be annotated to - * convey information about the data required by the method. - * - * This function is left for the user convenience so the annotations can still be used to specify data. - * - * @param name - * name of the guard - * @param method - * the method that is invoked to compute given guard - */ - public void addGuard(String name, Method method) { - addGuard(name, method, ReflectionHelper.parseDataAnnotations(method)); - } - - /** - * Allows to add a new guard - * - * @param name - * the name of the guard - * @param method - * the method the guard represents - * @param data - * the list of data required for the guard to be computed - */ - public void addGuard(String name, Method method, List> data) { - guards.put(name, new GuardImpl(name, method, data)); - } - - /** - * Allows to add a new output data given the method providing it. This function can be called by a class which - * creates its own executable behaviour. - * - * @param method - * an annotated method providing the output data - */ - public void addDataOut(Method method) { - - DataOutImpl data = ReflectionHelper.parseReturnDataAnnotation(method); - dataOut.add(data); - dataOutName.put(data.name(), getMethodHandleFromMethod(method)); - } - - /** - * Allows to add a new output data given the method providing it and its annotation. - * - * @param method - * the method providing the data - * @param annotation - * the data annotation - */ - public void addDataOut(Method method, org.javabip.annotations.Data annotation) { - - DataOutImpl data = ReflectionHelper.parseReturnDataAnnotation(method, annotation); - dataOut.add(data); - dataOutName.put(data.name(), getMethodHandleFromMethod(method)); - - } - - private MethodHandle getMethodHandleFromMethod(Method method) { - MethodType methodType; - MethodHandle methodHandle = null; - MethodHandles.Lookup lookup = MethodHandles.lookup(); - methodType = MethodType.methodType(method.getReturnType(), method.getParameterTypes()); - try { - methodHandle = lookup.findVirtual(component.getClass(), method.getName(), methodType); - } catch (NoSuchMethodException e) { - ExceptionHelper.printExceptionTrace(logger, e, "When building behaviour for component " + componentType); - } catch (IllegalAccessException e) { - ExceptionHelper.printExceptionTrace(logger, e, "When building behaviour for component " + componentType); - } - return methodHandle; - } - } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourImpl.java index f3b35ddd..09093418 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourImpl.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/BehaviourImpl.java @@ -1,13 +1,13 @@ /* * Copyright 2012-2016 École polytechnique fédérale de Lausanne (EPFL), Switzerland * Copyright 2012-2016 Crossing-Tech SA, Switzerland - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,683 +18,776 @@ */ package org.javabip.executor; -import java.lang.invoke.MethodHandle; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.javabip.api.Data; -import org.javabip.api.DataOut; -import org.javabip.api.ExecutableBehaviour; -import org.javabip.api.Guard; -import org.javabip.api.Port; -import org.javabip.api.PortType; -import org.javabip.api.Transition; +import javafx.util.Pair; +import org.javabip.api.*; import org.javabip.exceptions.BIPException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandle; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + /** * Implements the Behaviour and ExecutableBehaviour interfaces, providing the behaviour of the component together with * additional helper structures. - * + * * @author Alina Zolotukhina */ class BehaviourImpl implements ExecutableBehaviour { - private String currentState; - - private String componentType; - - private Set states; - private ArrayList allPorts; - private ArrayList enforceablePorts; - private Map spontaneousPorts; - /** - * For each port provides data it needs for guards - */ - private Hashtable>> portToDataInForGuard; - /** - * For each port provides data it needs for transitions - */ - private Hashtable>> portToDataInForTransition; - - /** - * Maps state to its transitions - */ - private Hashtable> stateTransitions; - /** - * Maps state to its enforceable ports - */ - private Hashtable> stateToPorts; - // TODO DISCUSS since it's a hashtable, there cannot be several transitions with the same name - // for different data variables (see theory?) - /** - * Gives a Transition instance from two keys - first key is currentState, second key is transition name. - */ - private Hashtable> nameToTransition; - - private ArrayList allTransitions; - private ArrayList internalTransitions; - private ArrayList spontaneousTransitions; - private ArrayList enforceableTransitions; - /** - * for each enforceable transition get its port instance - */ - private Hashtable transitionToPort; - - /** - * The list of guards whose evaluation does not depend on data - */ - private ArrayList guardsWithoutData; - /** - * The list of guards whose evaluation depends on data - */ - private ArrayList guardsWithData; - - /** - * The list of dataOut variables for this component - */ - private ArrayList> dataOut; - - /** - * The map between the name of the out variable and the method computing it - */ - private Hashtable dataOutName; - - private Map> dataFromTransitionToPorts; - private Map> dataFromGuardsToPorts; - private Map> portsNeedingData; - - private Object bipComponent; - private Class componentClass; - - private Logger logger = LoggerFactory.getLogger(BehaviourImpl.class); - - // ******************************** Constructors ********************************************* - - /** - * Creation of Behaviour without providing dataOut. However, there can be some dataIn hidden in guards and - * transitions - * - * @param componentType - * @param currentState - * @param allTransitions - * @param allPorts - * @param states - * @param guards - * @param component - * @throws BIPException - */ - public BehaviourImpl(String componentType, String currentState, ArrayList allTransitions, - ArrayList allPorts, HashSet states, Collection guards, Object component) - throws BIPException { - - this.componentType = componentType; - this.currentState = currentState; - this.allTransitions = allTransitions; - this.allPorts = allPorts; - this.states = new HashSet(states); - this.guardsWithoutData = new ArrayList(); - this.guardsWithData = new ArrayList(); - for (Guard guard : guards) { - if (guard.hasData()) { - this.guardsWithData.add(guard); - } else { - this.guardsWithoutData.add(guard); - } - } - this.bipComponent = component; - this.componentClass = bipComponent.getClass(); - - portToDataInForGuard = new Hashtable>>(); - portToDataInForTransition = new Hashtable>>(); - dataFromTransitionToPorts = new HashMap>(); - dataFromGuardsToPorts = new HashMap>(); - portsNeedingData = new HashMap>(); - enforceablePorts = new ArrayList(); - spontaneousPorts = new Hashtable(); - for (Port port : allPorts) { - if (port.getType() == PortType.enforceable) { - enforceablePorts.add(port); - portToDataInForGuard.put(port, new HashSet>()); - portToDataInForTransition.put(port, new HashSet>()); - } - if (port.getType() == PortType.spontaneous) - spontaneousPorts.put(port.getId(), port); - } - - stateToPorts = new Hashtable>(states.size()); - stateTransitions = new Hashtable>(); - nameToTransition = new Hashtable>(); - for (String state : states) { - stateToPorts.put(state, new HashSet()); - stateTransitions.put(state, new ArrayList()); - nameToTransition.put(state, new Hashtable()); - } - - HashMap mapIdToPort = new HashMap(); - for (Port port : allPorts) - mapIdToPort.put(port.getId(), port); - - this.internalTransitions = new ArrayList(); - this.spontaneousTransitions = new ArrayList(); - this.enforceableTransitions = new ArrayList(); - for (ExecutableTransition transition : allTransitions) { - - stateTransitions.get(transition.source()).add(transition); - nameToTransition.get(transition.source()).put(transition.name(), transition); - - switch (transition.getType()) { - case enforceable: - enforceableTransitions.add(transition); - break; - - case internal: - internalTransitions.add(transition); - break; - - case spontaneous: - spontaneousTransitions.add(transition); - break; - - default: - break; - } - } - - transitionToPort = new Hashtable(); - for (ExecutableTransition transition : enforceableTransitions) { - - Port port = mapIdToPort.get(transition.name()); - - transitionToPort.put(transition, port); - - if (transition.hasGuard()) { - Set> portGuardData = portToDataInForGuard.get(port); - for (Guard guard : transition.transitionGuards()) { - portGuardData.addAll(guard.dataRequired()); - for (Data data : guard.dataRequired()) { - // for each data in guard data, add it to guard collection - if (!dataFromGuardsToPorts.containsKey(data.name())) { - ArrayList dataPorts = new ArrayList(); - dataPorts.add(port); - dataFromGuardsToPorts.put(data.name(), dataPorts); - } else { - if (!dataFromGuardsToPorts.get(data.name()).contains(port)) { - dataFromGuardsToPorts.get(data.name()).add(port); - } - } - // for each data in guard data, add it to general collection (if not there) - updatePortsNeedingData(port, data); - } - } - } - - // (foreach is in enforceable but not in all) - Set> portTransitionData = portToDataInForTransition.get(port); - for (Data data : transition.dataRequired()) { - // for each data in transitions data, add it to transition collection - if (!dataFromTransitionToPorts.containsKey(data.name())) { - ArrayList dataPorts = new ArrayList(); - dataPorts.add(port); - dataFromTransitionToPorts.put(data.name(), dataPorts); - } else { - if (!dataFromTransitionToPorts.get(data.name()).contains(port)) { - dataFromTransitionToPorts.get(data.name()).add(port); - } - } - // for each data in transition data, add it to general collection (if not there) - updatePortsNeedingData(port, data); - portTransitionData.add(data); - } - - Set stateports = stateToPorts.get(transition.source()); - if (stateports == null) { - throw new BIPException("The source state " + transition.source() + " for transition " - + transition.name() + " is not in the list of states of component " + componentType); - } - stateports.add(port); - - } - - } - - private void updatePortsNeedingData(Port port, Data data) { - if (!portsNeedingData.containsKey(data.name())) { - ArrayList dataPorts = new ArrayList(); - dataPorts.add(port); - portsNeedingData.put(data.name(), dataPorts); - } else { - if (!portsNeedingData.get(data.name()).contains(port)) { - portsNeedingData.get(data.name()).add(port); - } - } - } - - /** - * Creation of Behaviour with dataOut. - * - * @param type - * @param currentState - * @param allTransitions - * @param allPorts - * @param states - * @param guards - * @param dataOut - * @param component - * @throws BIPException - */ - public BehaviourImpl(String type, String currentState, ArrayList allTransitions, - ArrayList allPorts, HashSet states, Collection guards, - ArrayList> dataOut, Hashtable dataOutName, Object component) - throws BIPException { - - this(type, currentState, allTransitions, allPorts, states, guards, component); - - this.dataOut = dataOut; - this.dataOutName = dataOutName; - - } - - // *************************** End of Constructors ******************************************* - - // ******************************* Getter functions ****************************************** - public String getCurrentState() { - return currentState; - } - - private ExecutableTransition getTransition(String state, String transitionName) { - return nameToTransition.get(state).get(transitionName); - } - - public Set getStates() { - return states; - } - - public Map> getStateToPorts() { - return stateToPorts; - } - - public Iterable getAllPorts() { - return this.allPorts; - } - - public List getEnforceablePorts() { - return enforceablePorts; - } - - public String getComponentType() { - return this.componentType; - } - - public Iterable getGuardsWithoutData() { - return this.guardsWithoutData; - } - - public Map getDataOutMapping() { - return dataOutName; - } - - public Iterable> portToDataInForTransition(Port port) { - return this.portToDataInForTransition.get(port); - } - - public Map>> portToDataInForGuard() { - return this.portToDataInForGuard; - } - - public Set> portToDataInForGuard(Port port) { - return this.portToDataInForGuard.get(port); - } - - public List portsNeedingData(String dataName) { - return portsNeedingData.get(dataName); - } - - public Set getDataProvidingPorts(String dataName) { - if (dataName == null || dataName.isEmpty()) { - return new HashSet(); - } - for (DataOut data : dataOut) { - if (data.name().equals(dataName)) { - return data.allowedPorts(); - } - } - return new HashSet(); - } - - public List getAllTransitions() { - List result = new ArrayList(allTransitions); - return result; - } - - // ************************** End of Getter functions **************************************** - - // ***************************** Transition existence **************************************** - - @Override - public boolean existInCurrentStateAndEnforceableWithData() { - - for (ExecutableTransition transition : stateTransitions.get(currentState)) { - if (transition.getType().equals(PortType.enforceable) && transition.hasDataOnGuards()) { - return true; - } - } - return false; - } - - @Override - public boolean existInCurrentStateAndEnabledEnforceableWithoutData(Map guardToValue) - throws BIPException { - - for (ExecutableTransition transition : enforceableTransitions) { - if (!transition.hasDataOnGuards() && isInCurrentStateAndEnabled(transition, guardToValue)) { - return true; - } - } - return false; - - } - - // TODO: The check that throws exception should be done by the Behaviour builder and not here - public boolean transitionNoDataGuardData(String port) throws BIPException { - ExecutableTransition transition = this.nameToTransition.get(currentState).get(port); - if (transition == null) { - throw new BIPException("No transition " + port + " from state " + currentState + " in component " - + componentType); - } - return transition.hasDataOnGuards() && !transition.hasData(); - } - - @Override - public boolean existInCurrentStateAndEnabledSpontaneous(Map guardToValue) { - - for (ExecutableTransition transition : spontaneousTransitions) { - if (isInCurrentStateAndEnabled(transition, guardToValue)) { - return true; - } - } - return false; - } - - @Override - public boolean existEnabledInternal(Map guardToValue) throws BIPException { - - boolean internalEnabled = false; - for (ExecutableTransition transition : internalTransitions) { - if (isInCurrentStateAndEnabled(transition, guardToValue)) { - if (internalEnabled) { - throw new BIPException("Cannot have two enabled internal transitions in the state " - + this.currentState + " in component " + this.componentType); - } else { - internalEnabled = true; - } - } - } - return internalEnabled; - - } - - @Override - public boolean isSpontaneousPort(String port) { - if (port == null || port.isEmpty()) { - throw new IllegalArgumentException("The name of the required port for the component " - + bipComponent.getClass().getName() + " cannot be null or empty."); - } - return spontaneousPorts.containsKey(port); - } - - // ************************** End of Transition existence ************************************ - - // ************************************** Enabledness **************************************** - - private boolean isInCurrentStateAndEnabled(ExecutableTransition transition, Map guardToValue) { - - if (!transition.source().equals(currentState)) { - return false; - } - - if (!transition.hasGuard()) { - return true; - } - - return transition.guardIsTrue(guardToValue); - } - - public boolean hasEnabledTransitionFromCurrentState(String portID, Map guardToValue) { - - ArrayList transitions = stateTransitions.get(currentState); - for (ExecutableTransition transition : transitions) { - if (transition.name().equals(portID)) { - return isInCurrentStateAndEnabled(transition, guardToValue); - } - } - return false; - } - - public Set getGloballyDisabledEnforceablePortsWithoutDataTransfer(Map guardToValue) { - HashSet result = new HashSet(); - for (ExecutableTransition transition : stateTransitions.get(currentState)) { - // Check only enforceable transitions - if (transition.getType().equals(PortType.enforceable)) { - - // Enforceable transition must have a guard without data and this guard has to evaluate to false. - if (transition.hasGuard() && !transition.hasDataOnGuards() && !transition.guardIsTrue(guardToValue)) { - result.add(transitionToPort.get(transition)); - } - - } - } - return result; - } - - public Map computeGuardsWithoutData(String currentState) { - // TODO BUG DESIGN compute only guards needed for this current state, as other - // guards not guaranteed to compute properly if executed in the wrong state. - - Hashtable guardToValue = new Hashtable(); - ArrayList transitionsFromState = stateTransitions.get(currentState); - for (ExecutableTransition transition : transitionsFromState) { - if (transition.hasGuard()) { - for (Guard guard : transition.transitionGuards()) { - if (this.guardsWithoutData.contains(guard)) { - try { - Object[] args = new Object[1]; - args[0] = bipComponent; - guardToValue.put(guard.name(), guard.evaluateGuard(args)); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - } - } - } - return guardToValue; - } - - public List checkEnabledness(String port, List> data) throws IllegalAccessException, - IllegalArgumentException, InvocationTargetException, BIPException { - - ArrayList result = new ArrayList(); - ExecutableTransition transition = getTransition(currentState, port); - // TODO DESIGN, find out why this can happen if the guard is not there, - // it does not need data, any data is good, no need to do check Enabledness? - // -- I think it does not happen, but it's here just in case - if (!transition.hasGuard()) { - for (int i = data.size(); i > 0; i--) { - result.add(true); - } - return result; - } - // for each different row of the data evaluation table - for (Map dataRow : data) { - Map guardToValue = new Hashtable(); - // for each Guard of this transition - for (Guard guard : transition.transitionGuards()) { - if (!guard.hasData()) { - Object[] args = new Object[1]; - args[0] = bipComponent; - guardToValue.put(guard.name(), guard.evaluateGuard(args)); - } else { - // if it has data, - // then for each data it needs add the corresponding value - // to the array of its arguments - ArrayList args = new ArrayList(); - args.add(bipComponent); - for (Data guardData : guard.dataRequired()) { - Object value = dataRow.get(guardData.name()); - args.add(value); - } - guardToValue.put(guard.name(), guard.evaluateGuard(args.toArray())); - } - } - result.add(transition.guardIsTrue(guardToValue)); - } - return result; - } - - // ******************************* End of enabledness **************************************** - // ************************************ Execution ******************************************** - - public void execute(String portID, Map data) { - // this component does not take part in the interaction - - if (portID == null) { - return; - } - // getTransition works correctly with spontaneous as well, as it addresses the list of all transitions - ExecutableTransition transition = getTransition(currentState, portID); - invokeMethod(transition, data); - } - - // ExecutorKernel, the owner of BehaviourImpl is checking the correctness of the execution. - public void executePort(String portID) throws BIPException { - // this component does not take part in the interaction - if (portID == null) { - return; - } - ExecutableTransition transition = getTransition(currentState, portID); - if (transition == null) { // this shouldn't normally happen - throw new BIPException("The spontaneous transition for port " + portID + " cannot be null after inform"); - } - invokeMethod(transition); - } - - public void executeInternal(Map guardToValue) throws BIPException { - - for (ExecutableTransition transition : stateTransitions.get(currentState)) { - if (transition.getType().equals(PortType.internal) && transition.guardIsTrue(guardToValue)) { - invokeMethod(transition); - return; - } - } - - throw new BIPException("There is no enabled internal transition in state " + this.currentState - + " for component " + this.componentType + ". This exception is internal to the implementation."); - - } - - private void invokeMethod(ExecutableTransition transition) { - MethodHandle methodHandle; - String errorMessage = "The following exception while executing " + transition.name() + " in component " - + this.componentType; - try { - logger.info("Invocation: " + transition.name()); - methodHandle = transition.methodHandle(); - if (!transition.method().getDeclaringClass().isAssignableFrom(componentClass)) { - throw new IllegalArgumentException("The method " + transition.method().getName() - + " belongs to the class " + transition.method().getDeclaringClass().getName() - + " but not to the class of the component " + componentClass.getName()); - } - Object[] args = new Object[1]; - args[0] = bipComponent; - methodHandle.invokeWithArguments(args); - - performTransition(transition); - - } catch (SecurityException e) { - ExceptionHelper.printExceptionTrace(logger, e, errorMessage); - } catch (IllegalAccessException e) { - ExceptionHelper.printExceptionTrace(logger, e, errorMessage); - } catch (IllegalArgumentException e) { - ExceptionHelper.printExceptionTrace(logger, e, errorMessage); - } catch (InvocationTargetException e) { - ExceptionHelper.printExceptionTrace(logger, e, errorMessage); - ExceptionHelper.printExceptionTrace(logger, e.getCause()); - } catch (BIPException e) { - ExceptionHelper.printExceptionTrace(logger, e, errorMessage); - } catch (Throwable e) { - ExceptionHelper.printExceptionTrace(logger, e); - } - } - - private void invokeMethod(ExecutableTransition transition, Map data) { - java.lang.reflect.Method componentMethod; - MethodHandle methodHandle; - try { - componentMethod = transition.method(); - methodHandle = transition.methodHandle(); - if (!componentMethod.getDeclaringClass().isAssignableFrom(componentClass)) { - throw new IllegalArgumentException("The method " + componentMethod.getName() + " belongs to the class " - + componentMethod.getDeclaringClass().getName() + " but not to the class of the component " - + componentClass.getName()); - } - - Object[] args = new Object[componentMethod.getParameterTypes().length + 1]; - args[0] = bipComponent; - int i = 1; - /* - * NOTE dataRequired works in the same manner for enforceable and spontaneous transitions, since it is - * processed by the builder who does not differentiate between them - */ - for (Data trData : transition.dataRequired()) { - // name parameter can not be null as it is enforced by the constructor. - Object value = data.get(trData.name()); - // TODO, CHECK, value can be null if the map is not properly constructed. Throw more informative - // exception. - args[i] = value; - i++; - } - logger.debug("In component " + this.componentType + " INVOCATION of " + transition.name() + " with args " - + data); - // if the method is not static, the first param to invokeExact should be treated as instance where to look - // for the method - methodHandle.invokeWithArguments(args); - - performTransition(transition); - } catch (SecurityException e) { - ExceptionHelper.printExceptionTrace(logger, e); - } catch (IllegalAccessException e) { - ExceptionHelper.printExceptionTrace(logger, e); - } catch (IllegalArgumentException e) { - ExceptionHelper.printExceptionTrace(logger, e); - } catch (InvocationTargetException e) { - ExceptionHelper.printExceptionTrace(logger, e); - ExceptionHelper.printExceptionTrace(logger, e.getTargetException()); - } catch (BIPException e) { - ExceptionHelper.printExceptionTrace(logger, e); - } catch (Throwable e) { - ExceptionHelper.printExceptionTrace(logger, e); - } - - } - - private void performTransition(ExecutableTransition transition) throws BIPException { - if (!currentState.equals(transition.source())) { - throw new BIPException("Could not perform transition " + transition.name() + " of component " - + componentType + " because the component is in the wrong state " + currentState - + " instead of state " + transition.source()); - } - currentState = transition.target(); - } - - // ****************************** End of Execution ******************************************* + private String currentState; + + private String componentType; + + private Set states; + private ArrayList allPorts; + private ArrayList enforceablePorts; + private Map spontaneousPorts; + /** + * For each port provides data it needs for guards + */ + private Hashtable>> portToDataInForGuard; + /** + * For each port provides data it needs for transitions + */ + private Hashtable>> portToDataInForTransition; + + /** + * Maps state to its transitions + */ + private Hashtable> stateTransitions; + /** + * Maps state to its enforceable ports + */ + private Hashtable> stateToPorts; + // TODO DISCUSS since it's a hashtable, there cannot be several transitions with the same name + // for different data variables (see theory?) + /** + * Gives a Transition instance from two keys - first key is currentState, second key is transition name. + */ + private Hashtable> nameToTransition; + + private ArrayList allTransitions; + private ArrayList internalTransitions; + private ArrayList spontaneousTransitions; + private ArrayList enforceableTransitions; + /** + * for each enforceable transition get its port instance + */ + private Hashtable transitionToPort; + + /** + * The list of guards whose evaluation does not depend on data + */ + private ArrayList guardsWithoutData; + /** + * The list of guards whose evaluation depends on data + */ + private ArrayList guardsWithData; + + /** + * The list of dataOut variables for this component + */ + private ArrayList> dataOut; + + /** + * The map between the name of the out variable and the method computing it + */ + private Hashtable dataOutName; + + private Map> dataFromTransitionToPorts; + private Map> dataFromGuardsToPorts; + private Map> portsNeedingData; + + private InvariantImpl invariant; + private HashMap transitionToPreConditionMap; + private HashMap transitionToPostConditionMap; + private HashMap stateToPredicateMap; + + private Object bipComponent; + private Class componentClass; + + private Logger logger = LoggerFactory.getLogger(BehaviourImpl.class); + + // ******************************** Constructors ********************************************* + + /** + * Creation of Behaviour without providing dataOut. However, there can be some dataIn hidden in guards and + * transitions + * + * @param componentType + * @param currentState + * @param allTransitions + * @param allPorts + * @param states + * @param guards + * @param component + * @param invariant + * @param transitionToPreConditionMap + * @param transitionToPostConditionMap + * @param stateToPredicateMap + * @throws BIPException + */ + public BehaviourImpl(String componentType, String currentState, ArrayList allTransitions, + ArrayList allPorts, HashSet states, Collection guards, Object component, InvariantImpl invariant, HashMap transitionToPreConditionMap, HashMap transitionToPostConditionMap, HashMap stateToPredicateMap) + throws BIPException { + + this.componentType = componentType; + this.currentState = currentState; + this.allTransitions = allTransitions; + this.allPorts = allPorts; + this.states = new HashSet(states); + this.guardsWithoutData = new ArrayList(); + this.guardsWithData = new ArrayList(); + for (Guard guard : guards) { + if (guard.hasData()) { + this.guardsWithData.add(guard); + } else { + this.guardsWithoutData.add(guard); + } + } + this.bipComponent = component; + this.componentClass = bipComponent.getClass(); + + portToDataInForGuard = new Hashtable>>(); + portToDataInForTransition = new Hashtable>>(); + dataFromTransitionToPorts = new HashMap>(); + dataFromGuardsToPorts = new HashMap>(); + portsNeedingData = new HashMap>(); + enforceablePorts = new ArrayList(); + spontaneousPorts = new Hashtable(); + for (Port port : allPorts) { + if (port.getType() == PortType.enforceable) { + enforceablePorts.add(port); + portToDataInForGuard.put(port, new HashSet>()); + portToDataInForTransition.put(port, new HashSet>()); + } + if (port.getType() == PortType.spontaneous) + spontaneousPorts.put(port.getId(), port); + } + + stateToPorts = new Hashtable>(states.size()); + stateTransitions = new Hashtable>(); + nameToTransition = new Hashtable>(); + for (String state : states) { + stateToPorts.put(state, new HashSet()); + stateTransitions.put(state, new ArrayList()); + nameToTransition.put(state, new Hashtable()); + } + + HashMap mapIdToPort = new HashMap(); + for (Port port : allPorts) + mapIdToPort.put(port.getId(), port); + + this.internalTransitions = new ArrayList(); + this.spontaneousTransitions = new ArrayList(); + this.enforceableTransitions = new ArrayList(); + for (ExecutableTransition transition : allTransitions) { + + stateTransitions.get(transition.source()).add(transition); + nameToTransition.get(transition.source()).put(transition.name(), transition); + + switch (transition.getType()) { + case enforceable: + enforceableTransitions.add(transition); + break; + + case internal: + internalTransitions.add(transition); + break; + + case spontaneous: + spontaneousTransitions.add(transition); + break; + + default: + break; + } + } + + transitionToPort = new Hashtable(); + for (ExecutableTransition transition : enforceableTransitions) { + + Port port = mapIdToPort.get(transition.name()); + + transitionToPort.put(transition, port); + + if (transition.hasGuard()) { + Set> portGuardData = portToDataInForGuard.get(port); + for (Guard guard : transition.transitionGuards()) { + portGuardData.addAll(guard.dataRequired()); + for (Data data : guard.dataRequired()) { + // for each data in guard data, add it to guard collection + if (!dataFromGuardsToPorts.containsKey(data.name())) { + ArrayList dataPorts = new ArrayList(); + dataPorts.add(port); + dataFromGuardsToPorts.put(data.name(), dataPorts); + } else { + if (!dataFromGuardsToPorts.get(data.name()).contains(port)) { + dataFromGuardsToPorts.get(data.name()).add(port); + } + } + // for each data in guard data, add it to general collection (if not there) + updatePortsNeedingData(port, data); + } + } + } + + // (foreach is in enforceable but not in all) + Set> portTransitionData = portToDataInForTransition.get(port); + for (Data data : transition.dataRequired()) { + // for each data in transitions data, add it to transition collection + if (!dataFromTransitionToPorts.containsKey(data.name())) { + ArrayList dataPorts = new ArrayList(); + dataPorts.add(port); + dataFromTransitionToPorts.put(data.name(), dataPorts); + } else { + if (!dataFromTransitionToPorts.get(data.name()).contains(port)) { + dataFromTransitionToPorts.get(data.name()).add(port); + } + } + // for each data in transition data, add it to general collection (if not there) + updatePortsNeedingData(port, data); + portTransitionData.add(data); + } + + Set stateports = stateToPorts.get(transition.source()); + if (stateports == null) { + throw new BIPException("The source state " + transition.source() + " for transition " + + transition.name() + " is not in the list of states of component " + componentType); + } + stateports.add(port); + + } + + this.invariant = invariant; + this.transitionToPreConditionMap = transitionToPreConditionMap; + this.transitionToPostConditionMap = transitionToPostConditionMap; + this.stateToPredicateMap = stateToPredicateMap; + } + + private void updatePortsNeedingData(Port port, Data data) { + if (!portsNeedingData.containsKey(data.name())) { + ArrayList dataPorts = new ArrayList(); + dataPorts.add(port); + portsNeedingData.put(data.name(), dataPorts); + } else { + if (!portsNeedingData.get(data.name()).contains(port)) { + portsNeedingData.get(data.name()).add(port); + } + } + } + + /** + * Creation of Behaviour with dataOut. + * + * @param type + * @param currentState + * @param allTransitions + * @param allPorts + * @param states + * @param guards + * @param dataOut + * @param component + * @param invariant + * @param transitionToPreConditionMap + * @param transitionToPostConditionMap + * @param stateToPredicateMap + * @throws BIPException + */ + public BehaviourImpl(String type, String currentState, ArrayList allTransitions, + ArrayList allPorts, HashSet states, Collection guards, + ArrayList> dataOut, Hashtable dataOutName, Object component, InvariantImpl invariant, HashMap transitionToPreConditionMap, HashMap transitionToPostConditionMap, HashMap stateToPredicateMap) + throws BIPException { + + this(type, currentState, allTransitions, allPorts, states, guards, component, invariant, transitionToPreConditionMap, transitionToPostConditionMap, stateToPredicateMap); + + this.dataOut = dataOut; + this.dataOutName = dataOutName; + + } + + // *************************** End of Constructors ******************************************* + + // ******************************* Getter functions ****************************************** + public String getCurrentState() { + return currentState; + } + + private ExecutableTransition getTransition(String state, String transitionName) { + return nameToTransition.get(state).get(transitionName); + } + + public Set getStates() { + return states; + } + + public Map> getStateToPorts() { + return stateToPorts; + } + + public Iterable getAllPorts() { + return this.allPorts; + } + + public List getEnforceablePorts() { + return enforceablePorts; + } + + public String getComponentType() { + return this.componentType; + } + + public Iterable getGuardsWithoutData() { + return this.guardsWithoutData; + } + + public Map getDataOutMapping() { + return dataOutName; + } + + public Iterable> portToDataInForTransition(Port port) { + return this.portToDataInForTransition.get(port); + } + + public Map>> portToDataInForGuard() { + return this.portToDataInForGuard; + } + + public Set> portToDataInForGuard(Port port) { + return this.portToDataInForGuard.get(port); + } + + public List portsNeedingData(String dataName) { + return portsNeedingData.get(dataName); + } + + public Set getDataProvidingPorts(String dataName) { + if (dataName == null || dataName.isEmpty()) { + return new HashSet(); + } + for (DataOut data : dataOut) { + if (data.name().equals(dataName)) { + return data.allowedPorts(); + } + } + return new HashSet(); + } + + public List getAllTransitions() { + List result = new ArrayList(allTransitions); + return result; + } + + // ************************** End of Getter functions **************************************** + + // ***************************** Transition existence **************************************** + + @Override + public boolean existInCurrentStateAndEnforceableWithData() { + + for (ExecutableTransition transition : stateTransitions.get(currentState)) { + if (transition.getType().equals(PortType.enforceable) && transition.hasDataOnGuards()) { + return true; + } + } + return false; + } + + @Override + public boolean existInCurrentStateAndEnabledEnforceableWithoutData(Map guardToValue) + throws BIPException { + + for (ExecutableTransition transition : enforceableTransitions) { + if (!transition.hasDataOnGuards() && isInCurrentStateAndEnabled(transition, guardToValue)) { + return true; + } + } + return false; + + } + + // TODO: The check that throws exception should be done by the Behaviour builder and not here + public boolean transitionNoDataGuardData(String port) throws BIPException { + ExecutableTransition transition = this.nameToTransition.get(currentState).get(port); + if (transition == null) { + throw new BIPException("No transition " + port + " from state " + currentState + " in component " + + componentType); + } + return transition.hasDataOnGuards() && !transition.hasData(); + } + + @Override + public boolean existInCurrentStateAndEnabledSpontaneous(Map guardToValue) { + + for (ExecutableTransition transition : spontaneousTransitions) { + if (isInCurrentStateAndEnabled(transition, guardToValue)) { + return true; + } + } + return false; + } + + @Override + public boolean existEnabledInternal(Map guardToValue) throws BIPException { + + boolean internalEnabled = false; + for (ExecutableTransition transition : internalTransitions) { + if (isInCurrentStateAndEnabled(transition, guardToValue)) { + if (internalEnabled) { + throw new BIPException("Cannot have two enabled internal transitions in the state " + + this.currentState + " in component " + this.componentType); + } else { + internalEnabled = true; + } + } + } + return internalEnabled; + + } + + @Override + public boolean isSpontaneousPort(String port) { + if (port == null || port.isEmpty()) { + throw new IllegalArgumentException("The name of the required port for the component " + + bipComponent.getClass().getName() + " cannot be null or empty."); + } + return spontaneousPorts.containsKey(port); + } + + // ************************** End of Transition existence ************************************ + + // ************************************** Enabledness **************************************** + + private boolean isInCurrentStateAndEnabled(ExecutableTransition transition, Map guardToValue) { + + if (!transition.source().equals(currentState)) { + return false; + } + + if (!transition.hasGuard()) { + return true; + } + + return transition.guardIsTrue(guardToValue); + } + + public boolean hasEnabledTransitionFromCurrentState(String portID, Map guardToValue) { + + ArrayList transitions = stateTransitions.get(currentState); + for (ExecutableTransition transition : transitions) { + if (transition.name().equals(portID)) { + return isInCurrentStateAndEnabled(transition, guardToValue); + } + } + return false; + } + + public Set getGloballyDisabledEnforceablePortsWithoutDataTransfer(Map guardToValue) { + HashSet result = new HashSet(); + for (ExecutableTransition transition : stateTransitions.get(currentState)) { + // Check only enforceable transitions + if (transition.getType().equals(PortType.enforceable)) { + + // Enforceable transition must have a guard without data and this guard has to evaluate to false. + if (transition.hasGuard() && !transition.hasDataOnGuards() && !transition.guardIsTrue(guardToValue)) { + result.add(transitionToPort.get(transition)); + } + + } + } + return result; + } + + public Map computeGuardsWithoutData(String currentState) { + // TODO BUG DESIGN compute only guards needed for this current state, as other + // guards not guaranteed to compute properly if executed in the wrong state. + + Hashtable guardToValue = new Hashtable(); + ArrayList transitionsFromState = stateTransitions.get(currentState); + for (ExecutableTransition transition : transitionsFromState) { + if (transition.hasGuard()) { + for (Guard guard : transition.transitionGuards()) { + if (this.guardsWithoutData.contains(guard)) { + try { + Object[] args = new Object[1]; + args[0] = bipComponent; + guardToValue.put(guard.name(), guard.evaluateGuard(args)); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + } + } + } + } + return guardToValue; + } + + public List checkEnabledness(String port, List> data) throws IllegalAccessException, + IllegalArgumentException, InvocationTargetException, BIPException { + + ArrayList result = new ArrayList(); + ExecutableTransition transition = getTransition(currentState, port); + // TODO DESIGN, find out why this can happen if the guard is not there, + // it does not need data, any data is good, no need to do check Enabledness? + // -- I think it does not happen, but it's here just in case + if (!transition.hasGuard()) { + for (int i = data.size(); i > 0; i--) { + result.add(true); + } + return result; + } + // for each different row of the data evaluation table + for (Map dataRow : data) { + Map guardToValue = new Hashtable(); + // for each Guard of this transition + for (Guard guard : transition.transitionGuards()) { + if (!guard.hasData()) { + Object[] args = new Object[1]; + args[0] = bipComponent; + guardToValue.put(guard.name(), guard.evaluateGuard(args)); + } else { + // if it has data, + // then for each data it needs add the corresponding value + // to the array of its arguments + ArrayList args = new ArrayList(); + args.add(bipComponent); + for (Data guardData : guard.dataRequired()) { + Object value = dataRow.get(guardData.name()); + args.add(value); + } + guardToValue.put(guard.name(), guard.evaluateGuard(args.toArray())); + } + } + result.add(transition.guardIsTrue(guardToValue)); + } + return result; + } + + // ******************************* End of enabledness **************************************** + // ************************************ Execution ******************************************** + + public void execute(String portID, Map data) throws BIPException { + // this component does not take part in the interaction + + if (portID == null) { + return; + } + + //check state predicate; + checkStatePredicate(currentState); + + // getTransition works correctly with spontaneous as well, as it addresses the list of all transitions + ExecutableTransition transition = getTransition(currentState, portID); + + //checkTransitionPreCondition(transition); + checkTransitionCondition(transition, true); + + invokeMethod(transition, data); + + //checkTransitionPostcondition(transition); + checkTransitionCondition(transition, false); + } + + // ExecutorKernel, the owner of BehaviourImpl is checking the correctness of the execution. + public void executePort(String portID) throws BIPException { + // this component does not take part in the interaction + if (portID == null) { + return; + } + ExecutableTransition transition = getTransition(currentState, portID); + if (transition == null) { // this shouldn't normally happen + throw new BIPException("The spontaneous transition for port " + portID + " cannot be null after inform"); + } + + //checkTransitionPreCondition(transition); + checkTransitionCondition(transition, true); + + invokeMethod(transition); + + //checkTransitionPostcondition(transition); + checkTransitionCondition(transition, false); + } + + public void executeInternal(Map guardToValue) throws BIPException { + + for (ExecutableTransition transition : stateTransitions.get(currentState)) { + if (transition.getType().equals(PortType.internal) && transition.guardIsTrue(guardToValue)) { + invokeMethod(transition); + return; + } + } + + throw new BIPException("There is no enabled internal transition in state " + this.currentState + + " for component " + this.componentType + ". This exception is internal to the implementation."); + + } + + private void invokeMethod(ExecutableTransition transition) { + MethodHandle methodHandle; + String errorMessage = "The following exception while executing " + transition.name() + " in component " + + this.componentType; + try { + logger.info("Invocation: " + transition.name()); + methodHandle = transition.methodHandle(); + if (!transition.method().getDeclaringClass().isAssignableFrom(componentClass)) { + throw new IllegalArgumentException("The method " + transition.method().getName() + + " belongs to the class " + transition.method().getDeclaringClass().getName() + + " but not to the class of the component " + componentClass.getName()); + } + Object[] args = new Object[1]; + args[0] = bipComponent; + methodHandle.invokeWithArguments(args); + + performTransition(transition); + + } catch (SecurityException e) { + ExceptionHelper.printExceptionTrace(logger, e, errorMessage); + } catch (IllegalAccessException e) { + ExceptionHelper.printExceptionTrace(logger, e, errorMessage); + } catch (IllegalArgumentException e) { + ExceptionHelper.printExceptionTrace(logger, e, errorMessage); + } catch (InvocationTargetException e) { + ExceptionHelper.printExceptionTrace(logger, e, errorMessage); + ExceptionHelper.printExceptionTrace(logger, e.getCause()); + } catch (BIPException e) { + ExceptionHelper.printExceptionTrace(logger, e, errorMessage); + } catch (Throwable e) { + ExceptionHelper.printExceptionTrace(logger, e); + } + } + + private void invokeMethod(ExecutableTransition transition, Map data) { + java.lang.reflect.Method componentMethod; + MethodHandle methodHandle; + try { + componentMethod = transition.method(); + methodHandle = transition.methodHandle(); + if (!componentMethod.getDeclaringClass().isAssignableFrom(componentClass)) { + throw new IllegalArgumentException("The method " + componentMethod.getName() + " belongs to the class " + + componentMethod.getDeclaringClass().getName() + " but not to the class of the component " + + componentClass.getName()); + } + + Object[] args = new Object[componentMethod.getParameterTypes().length + 1]; + args[0] = bipComponent; + int i = 1; + /* + * NOTE dataRequired works in the same manner for enforceable and spontaneous transitions, since it is + * processed by the builder who does not differentiate between them + */ + for (Data trData : transition.dataRequired()) { + // name parameter can not be null as it is enforced by the constructor. + Object value = data.get(trData.name()); + // TODO, CHECK, value can be null if the map is not properly constructed. Throw more informative + // exception. + args[i] = value; + i++; + } + logger.debug("In component " + this.componentType + " INVOCATION of " + transition.name() + " with args " + + data); + // if the method is not static, the first param to invokeExact should be treated as instance where to look + // for the method + methodHandle.invokeWithArguments(args); + + performTransition(transition); + } catch (SecurityException e) { + ExceptionHelper.printExceptionTrace(logger, e); + } catch (IllegalAccessException e) { + ExceptionHelper.printExceptionTrace(logger, e); + } catch (IllegalArgumentException e) { + ExceptionHelper.printExceptionTrace(logger, e); + } catch (InvocationTargetException e) { + ExceptionHelper.printExceptionTrace(logger, e); + ExceptionHelper.printExceptionTrace(logger, e.getTargetException()); + } catch (BIPException e) { + ExceptionHelper.printExceptionTrace(logger, e); + } catch (Throwable e) { + ExceptionHelper.printExceptionTrace(logger, e); + } + + } + + private void performTransition(ExecutableTransition transition) throws BIPException { + if (!currentState.equals(transition.source())) { + throw new BIPException("Could not perform transition " + transition.name() + " of component " + + componentType + " because the component is in the wrong state " + currentState + + " instead of state " + transition.source()); + } + currentState = transition.target(); + } + + // ****************************** End of Execution ******************************************* + + // ****************************** Invariants ******************************************* + + @Override + public Pair checkInvariant() { + if (invariant != null) + synchronized (this) { + try { + //return invariant.evaluateInvariant(componentClass, bipComponent); + return new Pair(invariant.evaluateInvariant(componentClass, bipComponent), invariant.expression()); + } catch (Exception e) { //TODO throw custom exception + e.printStackTrace(); + throw e; + } + } + //if there is no precondition we just ignore this execution + return new Pair(true, ""); + } + + @Override + public Pair checkTransitionCondition(Object transition, Boolean pre) { + InvariantImpl condition; + String message; + if (pre) { + condition = transitionToPreConditionMap.get((TransitionImpl) transition); + message = "PRE-CONDITION VIOLATION: "; + } else { + condition = transitionToPostConditionMap.get((TransitionImpl) transition); + message = "POST-CONDITION VIOLATION: "; + } + + if (condition != null) { + synchronized (this) { + try { + Pair result = new Pair(condition.evaluateInvariant(componentClass, bipComponent), condition.expression()); + if (!result.getKey()) { + System.out.println(message + result.getValue()); + } + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + } + return new Pair(true, ""); + } + + @Override + public Pair checkStatePredicate(String currentState) { + InvariantImpl statePredicate = stateToPredicateMap.get(currentState); + if (statePredicate != null) { + synchronized (this) { + try { + //return invariant.evaluateInvariant(componentClass, bipComponent); + Pair result = new Pair(statePredicate.evaluateInvariant(componentClass, bipComponent), statePredicate.expression()); + if (!result.getKey()) { + System.out.println("STATE PREDICATE VIOLATION: " + result.getValue() + ", STATE: " + currentState); + } + } catch (Exception e) { //TODO throw custom exception + e.printStackTrace(); + throw e; + } + } + } + //if there is no precondition we just ignore this execution + return new Pair(true, ""); + } + + + // ****************************** End of Invariant ******************************************* } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java index 95c5f734..4e3c8999 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ExecutorKernel.java @@ -8,6 +8,7 @@ package org.javabip.executor; +import javafx.util.Pair; import org.javabip.api.*; import org.javabip.exceptions.BIPException; import org.slf4j.Logger; @@ -97,7 +98,7 @@ public void setProxy(OrchestratedExecutor proxy) { * It registers the engine within given ExecutorKernel. The function setProxy must be called before with properly * constructed proxy or an exception will occur. */ - public void register(BIPEngine engine) { + public void register(BIPEngine engine) throws BIPException { if (proxy == null) { throw new BIPException("Proxy to provide multi-thread safety was not provided."); } @@ -125,7 +126,6 @@ public void deregister() { * @throws BIPException */ public void step() throws BIPException { - // if the actor was deregistered then it no longer does any steps. if (!registered) return; @@ -134,19 +134,35 @@ public void step() throws BIPException { guardToValue = behaviour.computeGuardsWithoutData(behaviour.getCurrentState()); + //check invariant before transition + //System.out.println("Invariant check before a transition."); + checkInvariant(); + // we have to compute this in order to be able to raise an exception boolean existInternalTransition = behaviour.existEnabledInternal(guardToValue); if (existInternalTransition) { logger.debug("About to execute internal transition for component {}", id); + + //compute invariant before + behaviour.checkInvariant(); + behaviour.executeInternal(guardToValue); logger.debug("Issuing next step message for component {}", id); + + //informing engine + engine.informInteral(proxy, behaviour.getCurrentState()); + // Scheduling the next execution step. proxy.step(); logger.debug("Finishing current step that has executed an internal transition for component {}", id); + + //check invariant after transition + System.out.println("Invariant check after an internal transition."); + checkInvariant(); + return; } - ; boolean existSpontaneousTransition = behaviour.existInCurrentStateAndEnabledSpontaneous(guardToValue); @@ -170,11 +186,19 @@ public void step() throws BIPException { behaviour.execute(port, data); } + //informing engine + engine.informSpontaneous(proxy, behaviour.getCurrentState()); logger.debug("Issuing next step message for component {}", id); + // Scheduling the next execution step. proxy.step(); logger.debug("Finishing current step that has executed a spontaneous transition for component {}", id); + + //check invariant after transition + System.out.println("Invariant check after a spontaneous transition."); + checkInvariant(); + return; } } @@ -192,6 +216,12 @@ public void step() throws BIPException { logger.debug("About to execute engine inform for component {}", id); engine.inform(proxy, behaviour.getCurrentState(), globallyDisabledPorts); // Next step will be invoked upon finishing treatment of the message execute. + + //TODO not sure it is a good place, since the transition might be still not executed + //check invariant after transition + //System.out.println("Invariant check after an enforceable transition."); + //checkInvariant(); + return; } @@ -220,6 +250,22 @@ public void step() throws BIPException { } + private void checkInvariant() { + try { + Pair result = behaviour.checkInvariant(); + if ( !result.getKey()) { + //logger.error("INVARIANT VIOLATION!"); + System.out.println("INVARIANT VIOLATION: " + result.getValue()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void checkStatePredicate(){ + behaviour.checkStatePredicate(behaviour.getCurrentState()); + } + /** * Executes a particular transition as told by the Engine */ @@ -264,16 +310,13 @@ else if (!behaviour.existInCurrentStateAndEnabledEnforceableWithoutData(guardToV } public void inform(String portID) { - inform(portID, null); - } @Override public void inform(String portID, Map data) { - // TODO DESIGN DISCUSSION what if the port (spontaneous) does not exist?. It should throw an exception or ignore - // it. + // TODO DESIGN DISCUSSION what if the port (spontaneous) does not exist?. It should throw an exception or ignore it. if (portID == null || portID.isEmpty() || !behaviour.isSpontaneousPort(portID)) { return; } @@ -288,7 +331,6 @@ public void inform(String portID, Map data) { waitingForSpontaneous = false; proxy.step(); } - } public T getData(String name, Class clazz) { diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java index bc49a4ed..0320370a 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/InvariantImpl.java @@ -21,6 +21,8 @@ package org.javabip.executor; import org.javabip.api.Invariant; +import org.javabip.verification.ast.ParsedJavaExpression; +import org.javabip.verification.visitors.PJEEvaluateVisitor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,28 +30,33 @@ class InvariantImpl implements Invariant { private Logger logger = LoggerFactory.getLogger(InvariantImpl.class); - private String expr; + private final String expression; - public InvariantImpl(String expr) { - this.expr = expr; + private ParsedJavaExpression parsedExpression; + + Object bipComponent; + + public InvariantImpl(String expression, ParsedJavaExpression invariantParsedExpression, Object bipComponent) { + this.expression = expression; + this.parsedExpression = invariantParsedExpression; + this.bipComponent = bipComponent; } - public String expr() { - return expr; + public String expression() { + return expression; } public String toString() { - StringBuilder result = new StringBuilder(); - - result.append("Invariant=("); - result.append("expr = " + expr()); - result.append(")"); + result + .append("Invariant=(expr = ") + .append(expression()) + .append(")"); return result.toString(); } - public boolean evaluateInvariant() { - throw new UnsupportedOperationException(); + public boolean evaluateInvariant( Class componentClass, Object bipComponent ) { + return (Boolean) parsedExpression.accept(new PJEEvaluateVisitor()); } } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/ReflectionHelper.java b/org.javabip.executor/src/main/java/org/javabip/executor/ReflectionHelper.java index e1bbf366..6b636fad 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/ReflectionHelper.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/ReflectionHelper.java @@ -20,15 +20,15 @@ package org.javabip.executor; +import org.javabip.api.Data; +import org.javabip.api.DataOut.AccessType; +import org.javabip.exceptions.BIPException; + import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import org.javabip.api.Data; -import org.javabip.api.DataOut.AccessType; -import org.javabip.exceptions.BIPException; - /** * A helper class providing functionality to parse the data-related information, such as annotations to method and * method parameters. diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java index 9f11c676..3231c398 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java @@ -100,6 +100,8 @@ private BehaviourBuilder parseAnnotations(Class componentClass) throws BIPExc String specType = ""; // TODO: Add simple test that forgets the componentType annotation to see whether the // Exception (else part) is thrown. + + Annotation classAnnotation = componentClass.getAnnotation(ComponentType.class); // get component name and type if (classAnnotation instanceof ComponentType) { @@ -126,6 +128,25 @@ private BehaviourBuilder parseAnnotations(Class componentClass) throws BIPExc throw new BIPException("Port information for the BIP component is not specified."); } + Invariant invariant = componentClass.getAnnotation(Invariant.class); + if (invariant != null){ + builder.buildInvariant(invariant.expr()); + } + + StatePredicates statePredicates = componentClass.getAnnotation(StatePredicates.class); + if (statePredicates != null){ + for (StatePredicate statePredicate : statePredicates.value()){ + builder.buildStatePredicate(statePredicate.expr(), statePredicate.state()); + + } + //builder.buildStatePredicate(statePredicate.expr(), behaviour.getCurrentState()); + } + + StatePredicate statePredicate = componentClass.getAnnotation(StatePredicate.class); + if (statePredicate != null){ + builder.buildStatePredicate(statePredicate.expr(), statePredicate.state()); + } + // get transitions & guards & data Method[] componentMethods = componentClass.getMethods(); for (Method method : componentMethods) { @@ -172,14 +193,12 @@ else if (annotation instanceof org.javabip.annotations.Port) { addPort((org.javabip.annotations.Port) annotation, componentClass, builder); } - else if (annotation instanceof Invariant) { - throw new UnsupportedOperationException(); - } + else if (annotation instanceof Pure) { - throw new UnsupportedOperationException(); + //throw new UnsupportedOperationException(); } else if (annotation instanceof StatePredicate) { - throw new UnsupportedOperationException(); + //throw new UnsupportedOperationException(); } } } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java b/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java index 78a6189b..0855121e 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/TransitionImpl.java @@ -27,6 +27,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.reflect.Method; +import java.util.Objects; /** * Stores the transition information about name, source state, target state, guard, method and required data. @@ -39,7 +40,7 @@ class TransitionImpl { protected String name; protected String source; protected String target; - // Empty string represents that there is no guard associated to this transition. + // Empty string represents that there is no guard (pre- or post-condition) associated to this transition. protected String guard; protected String pre; protected String post; @@ -109,4 +110,17 @@ private MethodHandle getMethodHandleForTransition() { } return methodHandle; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof TransitionImpl)) return false; + TransitionImpl that = (TransitionImpl) o; + return name.equals(that.name) && source.equals(that.source) && target.equals(that.target) && Objects.equals(guard, that.guard) && Objects.equals(pre, that.pre) && Objects.equals(post, that.post) && Objects.equals(method, that.method); + } + + @Override + public int hashCode() { + return Objects.hash(name, source, target, guard, pre, post, method); + } } From e4490cf20bdca613d2dc0672af4eea2e5e2740ba Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 18:54:52 +0200 Subject: [PATCH 17/19] moving guardsparser to the antlr v4 --- org.javabip.executor/pom.xml | 5 +- .../org/javabip/executor/guardparser/bool.g4 | 5 +- .../javabip/executor/guardparser/bool.interp | 31 +++ .../javabip/executor/guardparser/bool.tokens | 12 +- .../guardparser/boolBaseListener.java | 126 +++++++-- .../executor/guardparser/boolBaseVisitor.java | 57 +++++ .../executor/guardparser/boolLexer.interp | 38 +++ .../executor/guardparser/boolLexer.java | 131 +++++++--- .../executor/guardparser/boolLexer.tokens | 12 +- .../executor/guardparser/boolListener.java | 65 ++++- .../executor/guardparser/boolParser.java | 241 +++++++++++++----- .../executor/guardparser/boolVisitor.java | 50 ++++ 12 files changed, 613 insertions(+), 160 deletions(-) create mode 100644 org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.interp create mode 100644 org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseVisitor.java create mode 100644 org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.interp create mode 100644 org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolVisitor.java diff --git a/org.javabip.executor/pom.xml b/org.javabip.executor/pom.xml index e56bbbaf..34f81536 100644 --- a/org.javabip.executor/pom.xml +++ b/org.javabip.executor/pom.xml @@ -77,7 +77,6 @@ org.openjfx javafx-base - mac compile @@ -90,11 +89,11 @@ - + diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 index 260d5032..408b4b48 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 @@ -1,9 +1,8 @@ grammar bool; @header { -package org.bip.util.GuardsParser; import java.util.*; -import org.bip.util.Node; +import org.javabip.executor.GuardTreeNode; } @members{ @@ -32,7 +31,7 @@ NEGATION : '!'; WS : [ \t\r\n]+ -> skip; -ident : var=ID {stack.push(new Node($var.text));} | LPAREN ex=expr RPAREN {}; +ident : var=ID {stack.push(new GuardTreeNode($var.text));} | LPAREN ex=expr RPAREN {}; term : id=ident {} | NEGATION id=ident {nwc("!", stack.pop()); } ; manom : t=term {} | t=term INTERSECTION m=manom {nwc2("&", stack.pop(), stack.pop());}; expr_inner : m=manom {} | m=manom UNION e=expr_inner {nwc2("|", stack.pop(), stack.pop());}; diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.interp b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.interp new file mode 100644 index 00000000..5151b33a --- /dev/null +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.interp @@ -0,0 +1,31 @@ +token literal names: +null +'(' +')' +null +'|' +'&' +'!' +null + +token symbolic names: +null +LPAREN +RPAREN +ID +UNION +INTERSECTION +NEGATION +WS + +rule names: +ident +term +manom +expr_inner +expr +formula + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 9, 62, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 22, 10, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 31, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 41, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 51, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 58, 10, 6, 3, 7, 3, 7, 3, 7, 2, 2, 8, 2, 4, 6, 8, 10, 12, 2, 2, 2, 60, 2, 21, 3, 2, 2, 2, 4, 30, 3, 2, 2, 2, 6, 40, 3, 2, 2, 2, 8, 50, 3, 2, 2, 2, 10, 57, 3, 2, 2, 2, 12, 59, 3, 2, 2, 2, 14, 15, 7, 5, 2, 2, 15, 22, 8, 2, 1, 2, 16, 17, 7, 3, 2, 2, 17, 18, 5, 10, 6, 2, 18, 19, 7, 4, 2, 2, 19, 20, 8, 2, 1, 2, 20, 22, 3, 2, 2, 2, 21, 14, 3, 2, 2, 2, 21, 16, 3, 2, 2, 2, 22, 3, 3, 2, 2, 2, 23, 24, 5, 2, 2, 2, 24, 25, 8, 3, 1, 2, 25, 31, 3, 2, 2, 2, 26, 27, 7, 8, 2, 2, 27, 28, 5, 2, 2, 2, 28, 29, 8, 3, 1, 2, 29, 31, 3, 2, 2, 2, 30, 23, 3, 2, 2, 2, 30, 26, 3, 2, 2, 2, 31, 5, 3, 2, 2, 2, 32, 33, 5, 4, 3, 2, 33, 34, 8, 4, 1, 2, 34, 41, 3, 2, 2, 2, 35, 36, 5, 4, 3, 2, 36, 37, 7, 7, 2, 2, 37, 38, 5, 6, 4, 2, 38, 39, 8, 4, 1, 2, 39, 41, 3, 2, 2, 2, 40, 32, 3, 2, 2, 2, 40, 35, 3, 2, 2, 2, 41, 7, 3, 2, 2, 2, 42, 43, 5, 6, 4, 2, 43, 44, 8, 5, 1, 2, 44, 51, 3, 2, 2, 2, 45, 46, 5, 6, 4, 2, 46, 47, 7, 6, 2, 2, 47, 48, 5, 8, 5, 2, 48, 49, 8, 5, 1, 2, 49, 51, 3, 2, 2, 2, 50, 42, 3, 2, 2, 2, 50, 45, 3, 2, 2, 2, 51, 9, 3, 2, 2, 2, 52, 58, 5, 8, 5, 2, 53, 54, 7, 3, 2, 2, 54, 55, 5, 10, 6, 2, 55, 56, 7, 4, 2, 2, 56, 58, 3, 2, 2, 2, 57, 52, 3, 2, 2, 2, 57, 53, 3, 2, 2, 2, 58, 11, 3, 2, 2, 2, 59, 60, 5, 10, 6, 2, 60, 13, 3, 2, 2, 2, 7, 21, 30, 40, 50, 57] \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.tokens b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.tokens index 24d02975..cb64a5c6 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.tokens +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.tokens @@ -1,12 +1,12 @@ +LPAREN=1 RPAREN=2 -WS=7 -NEGATION=6 ID=3 -INTERSECTION=5 UNION=4 -LPAREN=1 -'!'=6 -'|'=4 +INTERSECTION=5 +NEGATION=6 +WS=7 '('=1 ')'=2 +'|'=4 '&'=5 +'!'=6 diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseListener.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseListener.java index 65be69fc..242b21fa 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseListener.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseListener.java @@ -1,31 +1,111 @@ -// Generated from bool.g4 by ANTLR 4.0 - +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 package org.javabip.executor.guardparser; + import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; +/** + * This class provides an empty implementation of {@link boolListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ public class boolBaseListener implements boolListener { - public void enterIdent(boolParser.IdentContext ctx) { } - public void exitIdent(boolParser.IdentContext ctx) { } - - public void enterTerm(boolParser.TermContext ctx) { } - public void exitTerm(boolParser.TermContext ctx) { } - - public void enterExpr(boolParser.ExprContext ctx) { } - public void exitExpr(boolParser.ExprContext ctx) { } - - public void enterManom(boolParser.ManomContext ctx) { } - public void exitManom(boolParser.ManomContext ctx) { } - - public void enterExpr_inner(boolParser.Expr_innerContext ctx) { } - public void exitExpr_inner(boolParser.Expr_innerContext ctx) { } - - public void enterFormula(boolParser.FormulaContext ctx) { } - public void exitFormula(boolParser.FormulaContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdent(boolParser.IdentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdent(boolParser.IdentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTerm(boolParser.TermContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTerm(boolParser.TermContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterManom(boolParser.ManomContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitManom(boolParser.ManomContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpr_inner(boolParser.Expr_innerContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpr_inner(boolParser.Expr_innerContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpr(boolParser.ExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpr(boolParser.ExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFormula(boolParser.FormulaContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFormula(boolParser.FormulaContext ctx) { } - public void enterEveryRule(ParserRuleContext ctx) { } - public void exitEveryRule(ParserRuleContext ctx) { } - public void visitTerminal(TerminalNode node) { } - public void visitErrorNode(ErrorNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } } \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseVisitor.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseVisitor.java new file mode 100644 index 00000000..f461a6ae --- /dev/null +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolBaseVisitor.java @@ -0,0 +1,57 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 +package org.javabip.executor.guardparser; + +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link boolVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public class boolBaseVisitor extends AbstractParseTreeVisitor implements boolVisitor { + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdent(boolParser.IdentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTerm(boolParser.TermContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitManom(boolParser.ManomContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpr_inner(boolParser.Expr_innerContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpr(boolParser.ExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFormula(boolParser.FormulaContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.interp b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.interp new file mode 100644 index 00000000..13a2c3de --- /dev/null +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.interp @@ -0,0 +1,38 @@ +token literal names: +null +'(' +')' +null +'|' +'&' +'!' +null + +token symbolic names: +null +LPAREN +RPAREN +ID +UNION +INTERSECTION +NEGATION +WS + +rule names: +LPAREN +RPAREN +ID +UNION +INTERSECTION +NEGATION +WS + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 9, 41, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 7, 4, 24, 10, 4, 12, 4, 14, 4, 27, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 6, 8, 36, 10, 8, 13, 8, 14, 8, 37, 3, 8, 3, 8, 2, 2, 9, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 3, 2, 5, 5, 2, 67, 92, 97, 97, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 42, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 3, 17, 3, 2, 2, 2, 5, 19, 3, 2, 2, 2, 7, 21, 3, 2, 2, 2, 9, 28, 3, 2, 2, 2, 11, 30, 3, 2, 2, 2, 13, 32, 3, 2, 2, 2, 15, 35, 3, 2, 2, 2, 17, 18, 7, 42, 2, 2, 18, 4, 3, 2, 2, 2, 19, 20, 7, 43, 2, 2, 20, 6, 3, 2, 2, 2, 21, 25, 9, 2, 2, 2, 22, 24, 9, 3, 2, 2, 23, 22, 3, 2, 2, 2, 24, 27, 3, 2, 2, 2, 25, 23, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 8, 3, 2, 2, 2, 27, 25, 3, 2, 2, 2, 28, 29, 7, 126, 2, 2, 29, 10, 3, 2, 2, 2, 30, 31, 7, 40, 2, 2, 31, 12, 3, 2, 2, 2, 32, 33, 7, 35, 2, 2, 33, 14, 3, 2, 2, 2, 34, 36, 9, 4, 2, 2, 35, 34, 3, 2, 2, 2, 36, 37, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 39, 3, 2, 2, 2, 39, 40, 8, 8, 2, 2, 40, 16, 3, 2, 2, 2, 5, 2, 25, 37, 3, 8, 2, 2] \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.java index 15bf1bbb..b3d41572 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.java @@ -1,44 +1,97 @@ -// Generated from bool.g4 by ANTLR 4.0 - +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 package org.javabip.executor.guardparser; -import java.util.*; -import org.javabip.executor.GuardTreeNode; import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.atn.ATN; +import org.antlr.v4.runtime.atn.ATNDeserializer; +import org.antlr.v4.runtime.atn.LexerATNSimulator; +import org.antlr.v4.runtime.atn.PredictionContextCache; import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; +import org.javabip.executor.GuardTreeNode; + +import java.util.Stack; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class boolLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int LPAREN=1, RPAREN=2, ID=3, UNION=4, INTERSECTION=5, NEGATION=6, WS=7; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + public static String[] modeNames = { "DEFAULT_MODE" }; - public static final String[] tokenNames = { - "", - "'('", "')'", "ID", "'|'", "'&'", "'!'", "WS" - }; - public static final String[] ruleNames = { - "LPAREN", "RPAREN", "ID", "UNION", "INTERSECTION", "NEGATION", "WS" - }; + private static String[] makeRuleNames() { + return new String[] { + "LPAREN", "RPAREN", "ID", "UNION", "INTERSECTION", "NEGATION", "WS" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'('", "')'", null, "'|'", "'&'", "'!'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "LPAREN", "RPAREN", "ID", "UNION", "INTERSECTION", "NEGATION", + "WS" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } public Stack stack = new Stack(); public void nwc(String s, GuardTreeNode t){ - GuardTreeNode n = new GuardTreeNode(s); + GuardTreeNode n = new GuardTreeNode(s); t.attachToNode(n); stack.push(n); } public void nwc2(String s, GuardTreeNode t, GuardTreeNode t2){ - GuardTreeNode n = new GuardTreeNode(s); + GuardTreeNode n = new GuardTreeNode(s); t.attachToNode(n); t2.attachToNode(n); stack.push(n); @@ -54,45 +107,39 @@ public boolLexer(CharStream input) { public String getGrammarFileName() { return "bool.g4"; } @Override - public String[] getTokenNames() { return tokenNames; } + public String[] getRuleNames() { return ruleNames; } @Override - public String[] getRuleNames() { return ruleNames; } + public String getSerializedATN() { return _serializedATN; } @Override - public String[] getModeNames() { return modeNames; } + public String[] getChannelNames() { return channelNames; } @Override - public ATN getATN() { return _ATN; } + public String[] getModeNames() { return modeNames; } @Override - public void action(RuleContext _localctx, int ruleIndex, int actionIndex) { - switch (ruleIndex) { - case 6: WS_action((RuleContext)_localctx, actionIndex); break; - } - } - private void WS_action(RuleContext _localctx, int actionIndex) { - switch (actionIndex) { - case 0: skip(); break; - } - } + public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\2\4\t)\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\3"+ - "\2\3\2\3\3\3\3\3\4\3\4\7\4\30\n\4\f\4\16\4\33\13\4\3\5\3\5\3\6\3\6\3\7"+ - "\3\7\3\b\6\b$\n\b\r\b\16\b%\3\b\3\b\2\t\3\3\1\5\4\1\7\5\1\t\6\1\13\7\1"+ - "\r\b\1\17\t\2\3\2\5\5C\\aac|\6\62;C\\aac|\5\13\f\17\17\"\"*\2\3\3\2\2"+ - "\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3"+ - "\2\2\2\3\21\3\2\2\2\5\23\3\2\2\2\7\25\3\2\2\2\t\34\3\2\2\2\13\36\3\2\2"+ - "\2\r \3\2\2\2\17#\3\2\2\2\21\22\7*\2\2\22\4\3\2\2\2\23\24\7+\2\2\24\6"+ - "\3\2\2\2\25\31\t\2\2\2\26\30\t\3\2\2\27\26\3\2\2\2\30\33\3\2\2\2\31\27"+ - "\3\2\2\2\31\32\3\2\2\2\32\b\3\2\2\2\33\31\3\2\2\2\34\35\7~\2\2\35\n\3"+ - "\2\2\2\36\37\7(\2\2\37\f\3\2\2\2 !\7#\2\2!\16\3\2\2\2\"$\t\4\2\2#\"\3"+ - "\2\2\2$%\3\2\2\2%#\3\2\2\2%&\3\2\2\2&\'\3\2\2\2\'(\b\b\2\2(\20\3\2\2\2"+ - "\5\2\31%"; + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\t)\b\1\4\2\t\2\4"+ + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\3\2\3\2\3\3\3\3\3\4\3\4"+ + "\7\4\30\n\4\f\4\16\4\33\13\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\6\b$\n\b\r\b"+ + "\16\b%\3\b\3\b\2\2\t\3\3\5\4\7\5\t\6\13\7\r\b\17\t\3\2\5\5\2C\\aac|\6"+ + "\2\62;C\\aac|\5\2\13\f\17\17\"\"\2*\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2"+ + "\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\3\21\3\2\2\2\5\23"+ + "\3\2\2\2\7\25\3\2\2\2\t\34\3\2\2\2\13\36\3\2\2\2\r \3\2\2\2\17#\3\2\2"+ + "\2\21\22\7*\2\2\22\4\3\2\2\2\23\24\7+\2\2\24\6\3\2\2\2\25\31\t\2\2\2\26"+ + "\30\t\3\2\2\27\26\3\2\2\2\30\33\3\2\2\2\31\27\3\2\2\2\31\32\3\2\2\2\32"+ + "\b\3\2\2\2\33\31\3\2\2\2\34\35\7~\2\2\35\n\3\2\2\2\36\37\7(\2\2\37\f\3"+ + "\2\2\2 !\7#\2\2!\16\3\2\2\2\"$\t\4\2\2#\"\3\2\2\2$%\3\2\2\2%#\3\2\2\2"+ + "%&\3\2\2\2&\'\3\2\2\2\'(\b\b\2\2(\20\3\2\2\2\5\2\31%\3\b\2\2"; public static final ATN _ATN = - ATNSimulator.deserialize(_serializedATN.toCharArray()); + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } } } \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.tokens b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.tokens index 24d02975..cb64a5c6 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.tokens +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolLexer.tokens @@ -1,12 +1,12 @@ +LPAREN=1 RPAREN=2 -WS=7 -NEGATION=6 ID=3 -INTERSECTION=5 UNION=4 -LPAREN=1 -'!'=6 -'|'=4 +INTERSECTION=5 +NEGATION=6 +WS=7 '('=1 ')'=2 +'|'=4 '&'=5 +'!'=6 diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolListener.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolListener.java index c72254bc..893f802d 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolListener.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolListener.java @@ -1,24 +1,71 @@ -// Generated from bool.g4 by ANTLR 4.0 - +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 package org.javabip.executor.guardparser; + import org.antlr.v4.runtime.tree.ParseTreeListener; +/** + * This interface defines a complete listener for a parse tree produced by + * {@link boolParser}. + */ public interface boolListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link boolParser#ident}. + * @param ctx the parse tree + */ void enterIdent(boolParser.IdentContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#ident}. + * @param ctx the parse tree + */ void exitIdent(boolParser.IdentContext ctx); - + /** + * Enter a parse tree produced by {@link boolParser#term}. + * @param ctx the parse tree + */ void enterTerm(boolParser.TermContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#term}. + * @param ctx the parse tree + */ void exitTerm(boolParser.TermContext ctx); - - void enterExpr(boolParser.ExprContext ctx); - void exitExpr(boolParser.ExprContext ctx); - + /** + * Enter a parse tree produced by {@link boolParser#manom}. + * @param ctx the parse tree + */ void enterManom(boolParser.ManomContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#manom}. + * @param ctx the parse tree + */ void exitManom(boolParser.ManomContext ctx); - + /** + * Enter a parse tree produced by {@link boolParser#expr_inner}. + * @param ctx the parse tree + */ void enterExpr_inner(boolParser.Expr_innerContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#expr_inner}. + * @param ctx the parse tree + */ void exitExpr_inner(boolParser.Expr_innerContext ctx); - + /** + * Enter a parse tree produced by {@link boolParser#expr}. + * @param ctx the parse tree + */ + void enterExpr(boolParser.ExprContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#expr}. + * @param ctx the parse tree + */ + void exitExpr(boolParser.ExprContext ctx); + /** + * Enter a parse tree produced by {@link boolParser#formula}. + * @param ctx the parse tree + */ void enterFormula(boolParser.FormulaContext ctx); + /** + * Exit a parse tree produced by {@link boolParser#formula}. + * @param ctx the parse tree + */ void exitFormula(boolParser.FormulaContext ctx); } \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolParser.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolParser.java index c9385358..3731068a 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolParser.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolParser.java @@ -1,45 +1,93 @@ -// Generated from bool.g4 by ANTLR 4.0 - +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 package org.javabip.executor.guardparser; -import java.util.*; -import org.javabip.executor.GuardTreeNode; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; +import org.antlr.v4.runtime.atn.ATN; +import org.antlr.v4.runtime.atn.ATNDeserializer; +import org.antlr.v4.runtime.atn.ParserATNSimulator; +import org.antlr.v4.runtime.atn.PredictionContextCache; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.javabip.executor.GuardTreeNode; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; +import java.util.Stack; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class boolParser extends Parser { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int LPAREN=1, RPAREN=2, ID=3, UNION=4, INTERSECTION=5, NEGATION=6, WS=7; - public static final String[] tokenNames = { - "", "'('", "')'", "ID", "'|'", "'&'", "'!'", "WS" - }; public static final int RULE_ident = 0, RULE_term = 1, RULE_manom = 2, RULE_expr_inner = 3, RULE_expr = 4, RULE_formula = 5; - public static final String[] ruleNames = { - "ident", "term", "manom", "expr_inner", "expr", "formula" - }; + private static String[] makeRuleNames() { + return new String[] { + "ident", "term", "manom", "expr_inner", "expr", "formula" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'('", "')'", null, "'|'", "'&'", "'!'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "LPAREN", "RPAREN", "ID", "UNION", "INTERSECTION", "NEGATION", + "WS" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } @Override - public String getGrammarFileName() { return "bool.g4"; } + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } @Override - public String[] getTokenNames() { return tokenNames; } + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "bool.g4"; } @Override public String[] getRuleNames() { return ruleNames; } + @Override + public String getSerializedATN() { return _serializedATN; } + @Override public ATN getATN() { return _ATN; } @@ -47,13 +95,13 @@ public class boolParser extends Parser { public Stack stack = new Stack(); public void nwc(String s, GuardTreeNode t){ - GuardTreeNode n = new GuardTreeNode(s); + GuardTreeNode n = new GuardTreeNode(s); t.attachToNode(n); stack.push(n); } public void nwc2(String s, GuardTreeNode t, GuardTreeNode t2){ - GuardTreeNode n = new GuardTreeNode(s); + GuardTreeNode n = new GuardTreeNode(s); t.attachToNode(n); t2.attachToNode(n); stack.push(n); @@ -63,15 +111,16 @@ public boolParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } + public static class IdentContext extends ParserRuleContext { public Token var; public ExprContext ex; - public TerminalNode RPAREN() { return getToken(boolParser.RPAREN, 0); } public TerminalNode ID() { return getToken(boolParser.ID, 0); } + public TerminalNode LPAREN() { return getToken(boolParser.LPAREN, 0); } + public TerminalNode RPAREN() { return getToken(boolParser.RPAREN, 0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } - public TerminalNode LPAREN() { return getToken(boolParser.LPAREN, 0); } public IdentContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -84,6 +133,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitIdent(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitIdent(this); + else return visitor.visitChildren(this); + } } public final IdentContext ident() throws RecognitionException { @@ -91,20 +145,25 @@ public final IdentContext ident() throws RecognitionException { enterRule(_localctx, 0, RULE_ident); try { setState(19); + _errHandler.sync(this); switch (_input.LA(1)) { case ID: enterOuterAlt(_localctx, 1); { - setState(12); ((IdentContext)_localctx).var = match(ID); + setState(12); + ((IdentContext)_localctx).var = match(ID); stack.push(new GuardTreeNode((((IdentContext)_localctx).var!=null?((IdentContext)_localctx).var.getText():null))); } break; case LPAREN: enterOuterAlt(_localctx, 2); { - setState(14); match(LPAREN); - setState(15); ((IdentContext)_localctx).ex = expr(); - setState(16); match(RPAREN); + setState(14); + match(LPAREN); + setState(15); + ((IdentContext)_localctx).ex = expr(); + setState(16); + match(RPAREN); } break; @@ -141,6 +200,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitTerm(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitTerm(this); + else return visitor.visitChildren(this); + } } public final TermContext term() throws RecognitionException { @@ -148,20 +212,24 @@ public final TermContext term() throws RecognitionException { enterRule(_localctx, 2, RULE_term); try { setState(28); + _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: case ID: enterOuterAlt(_localctx, 1); { - setState(21); ((TermContext)_localctx).id = ident(); + setState(21); + ((TermContext)_localctx).id = ident(); } break; case NEGATION: enterOuterAlt(_localctx, 2); { - setState(24); match(NEGATION); - setState(25); ((TermContext)_localctx).id = ident(); + setState(24); + match(NEGATION); + setState(25); + ((TermContext)_localctx).id = ident(); nwc("!", stack.pop()); } break; @@ -186,10 +254,10 @@ public static class ManomContext extends ParserRuleContext { public TermContext term() { return getRuleContext(TermContext.class,0); } + public TerminalNode INTERSECTION() { return getToken(boolParser.INTERSECTION, 0); } public ManomContext manom() { return getRuleContext(ManomContext.class,0); } - public TerminalNode INTERSECTION() { return getToken(boolParser.INTERSECTION, 0); } public ManomContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -202,6 +270,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitManom(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitManom(this); + else return visitor.visitChildren(this); + } } public final ManomContext manom() throws RecognitionException { @@ -209,21 +282,25 @@ public final ManomContext manom() throws RecognitionException { enterRule(_localctx, 4, RULE_manom); try { setState(38); + _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(30); ((ManomContext)_localctx).t = term(); + setState(30); + ((ManomContext)_localctx).t = term(); } break; - case 2: enterOuterAlt(_localctx, 2); { - setState(33); ((ManomContext)_localctx).t = term(); - setState(34); match(INTERSECTION); - setState(35); ((ManomContext)_localctx).m = manom(); + setState(33); + ((ManomContext)_localctx).t = term(); + setState(34); + match(INTERSECTION); + setState(35); + ((ManomContext)_localctx).m = manom(); nwc2("&", stack.pop(), stack.pop()); } break; @@ -262,6 +339,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitExpr_inner(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitExpr_inner(this); + else return visitor.visitChildren(this); + } } public final Expr_innerContext expr_inner() throws RecognitionException { @@ -269,21 +351,25 @@ public final Expr_innerContext expr_inner() throws RecognitionException { enterRule(_localctx, 6, RULE_expr_inner); try { setState(48); + _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(40); ((Expr_innerContext)_localctx).m = manom(); + setState(40); + ((Expr_innerContext)_localctx).m = manom(); } break; - case 2: enterOuterAlt(_localctx, 2); { - setState(43); ((Expr_innerContext)_localctx).m = manom(); - setState(44); match(UNION); - setState(45); ((Expr_innerContext)_localctx).e = expr_inner(); + setState(43); + ((Expr_innerContext)_localctx).m = manom(); + setState(44); + match(UNION); + setState(45); + ((Expr_innerContext)_localctx).e = expr_inner(); nwc2("|", stack.pop(), stack.pop()); } break; @@ -301,14 +387,14 @@ public final Expr_innerContext expr_inner() throws RecognitionException { } public static class ExprContext extends ParserRuleContext { - public TerminalNode RPAREN() { return getToken(boolParser.RPAREN, 0); } - public ExprContext expr() { - return getRuleContext(ExprContext.class,0); - } - public TerminalNode LPAREN() { return getToken(boolParser.LPAREN, 0); } public Expr_innerContext expr_inner() { return getRuleContext(Expr_innerContext.class,0); } + public TerminalNode LPAREN() { return getToken(boolParser.LPAREN, 0); } + public ExprContext expr() { + return getRuleContext(ExprContext.class,0); + } + public TerminalNode RPAREN() { return getToken(boolParser.RPAREN, 0); } public ExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -321,6 +407,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitExpr(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitExpr(this); + else return visitor.visitChildren(this); + } } public final ExprContext expr() throws RecognitionException { @@ -328,20 +419,24 @@ public final ExprContext expr() throws RecognitionException { enterRule(_localctx, 8, RULE_expr); try { setState(55); + _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(50); expr_inner(); + setState(50); + expr_inner(); } break; - case 2: enterOuterAlt(_localctx, 2); { - setState(51); match(LPAREN); - setState(52); expr(); - setState(53); match(RPAREN); + setState(51); + match(LPAREN); + setState(52); + expr(); + setState(53); + match(RPAREN); } break; } @@ -373,6 +468,11 @@ public void enterRule(ParseTreeListener listener) { public void exitRule(ParseTreeListener listener) { if ( listener instanceof boolListener ) ((boolListener)listener).exitFormula(this); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof boolVisitor ) return ((boolVisitor)visitor).visitFormula(this); + else return visitor.visitChildren(this); + } } public final FormulaContext formula() throws RecognitionException { @@ -381,7 +481,8 @@ public final FormulaContext formula() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(57); expr(); + setState(57); + expr(); } } catch (RecognitionException re) { @@ -396,24 +497,28 @@ public final FormulaContext formula() throws RecognitionException { } public static final String _serializedATN = - "\2\3\t>\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\3\2\3\2\3\2\3"+ - "\2\3\2\3\2\3\2\5\2\26\n\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\37\n\3\3\4\3"+ - "\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4)\n\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5"+ - "\5\63\n\5\3\6\3\6\3\6\3\6\3\6\5\6:\n\6\3\7\3\7\3\7\2\b\2\4\6\b\n\f\2\2"+ - "<\2\25\3\2\2\2\4\36\3\2\2\2\6(\3\2\2\2\b\62\3\2\2\2\n9\3\2\2\2\f;\3\2"+ - "\2\2\16\17\7\5\2\2\17\26\b\2\1\2\20\21\7\3\2\2\21\22\5\n\6\2\22\23\7\4"+ - "\2\2\23\24\b\2\1\2\24\26\3\2\2\2\25\16\3\2\2\2\25\20\3\2\2\2\26\3\3\2"+ - "\2\2\27\30\5\2\2\2\30\31\b\3\1\2\31\37\3\2\2\2\32\33\7\b\2\2\33\34\5\2"+ - "\2\2\34\35\b\3\1\2\35\37\3\2\2\2\36\27\3\2\2\2\36\32\3\2\2\2\37\5\3\2"+ - "\2\2 !\5\4\3\2!\"\b\4\1\2\")\3\2\2\2#$\5\4\3\2$%\7\7\2\2%&\5\6\4\2&\'"+ - "\b\4\1\2\')\3\2\2\2( \3\2\2\2(#\3\2\2\2)\7\3\2\2\2*+\5\6\4\2+,\b\5\1\2"+ - ",\63\3\2\2\2-.\5\6\4\2./\7\6\2\2/\60\5\b\5\2\60\61\b\5\1\2\61\63\3\2\2"+ - "\2\62*\3\2\2\2\62-\3\2\2\2\63\t\3\2\2\2\64:\5\b\5\2\65\66\7\3\2\2\66\67"+ - "\5\n\6\2\678\7\4\2\28:\3\2\2\29\64\3\2\2\29\65\3\2\2\2:\13\3\2\2\2;<\5"+ - "\n\6\2<\r\3\2\2\2\7\25\36(\629"; + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\t>\4\2\t\2\4\3\t"+ + "\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\3\2\3\2\3\2\3\2\3\2\3\2\3\2\5\2\26"+ + "\n\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\37\n\3\3\4\3\4\3\4\3\4\3\4\3\4\3"+ + "\4\3\4\5\4)\n\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5\63\n\5\3\6\3\6\3\6"+ + "\3\6\3\6\5\6:\n\6\3\7\3\7\3\7\2\2\b\2\4\6\b\n\f\2\2\2<\2\25\3\2\2\2\4"+ + "\36\3\2\2\2\6(\3\2\2\2\b\62\3\2\2\2\n9\3\2\2\2\f;\3\2\2\2\16\17\7\5\2"+ + "\2\17\26\b\2\1\2\20\21\7\3\2\2\21\22\5\n\6\2\22\23\7\4\2\2\23\24\b\2\1"+ + "\2\24\26\3\2\2\2\25\16\3\2\2\2\25\20\3\2\2\2\26\3\3\2\2\2\27\30\5\2\2"+ + "\2\30\31\b\3\1\2\31\37\3\2\2\2\32\33\7\b\2\2\33\34\5\2\2\2\34\35\b\3\1"+ + "\2\35\37\3\2\2\2\36\27\3\2\2\2\36\32\3\2\2\2\37\5\3\2\2\2 !\5\4\3\2!\""+ + "\b\4\1\2\")\3\2\2\2#$\5\4\3\2$%\7\7\2\2%&\5\6\4\2&\'\b\4\1\2\')\3\2\2"+ + "\2( \3\2\2\2(#\3\2\2\2)\7\3\2\2\2*+\5\6\4\2+,\b\5\1\2,\63\3\2\2\2-.\5"+ + "\6\4\2./\7\6\2\2/\60\5\b\5\2\60\61\b\5\1\2\61\63\3\2\2\2\62*\3\2\2\2\62"+ + "-\3\2\2\2\63\t\3\2\2\2\64:\5\b\5\2\65\66\7\3\2\2\66\67\5\n\6\2\678\7\4"+ + "\2\28:\3\2\2\29\64\3\2\2\29\65\3\2\2\2:\13\3\2\2\2;<\5\n\6\2<\r\3\2\2"+ + "\2\7\25\36(\629"; public static final ATN _ATN = - ATNSimulator.deserialize(_serializedATN.toCharArray()); + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } } } \ No newline at end of file diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolVisitor.java b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolVisitor.java new file mode 100644 index 00000000..8b111f8d --- /dev/null +++ b/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/boolVisitor.java @@ -0,0 +1,50 @@ +// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.executor/src/main/java/org/javabip/executor/guardparser/bool.g4 by ANTLR 4.9.2 +package org.javabip.executor.guardparser; + +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link boolParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface boolVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link boolParser#ident}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdent(boolParser.IdentContext ctx); + /** + * Visit a parse tree produced by {@link boolParser#term}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTerm(boolParser.TermContext ctx); + /** + * Visit a parse tree produced by {@link boolParser#manom}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitManom(boolParser.ManomContext ctx); + /** + * Visit a parse tree produced by {@link boolParser#expr_inner}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpr_inner(boolParser.Expr_innerContext ctx); + /** + * Visit a parse tree produced by {@link boolParser#expr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpr(boolParser.ExprContext ctx); + /** + * Visit a parse tree produced by {@link boolParser#formula}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFormula(boolParser.FormulaContext ctx); +} \ No newline at end of file From 2df344e4f170a97961dea9a7bad9f9070c569272 Mon Sep 17 00:00:00 2001 From: lsafina Date: Wed, 7 Sep 2022 18:58:11 +0200 Subject: [PATCH 18/19] simplify invariant --- .../src/main/java/org/javabip/annotations/Invariant.java | 4 ++-- .../main/java/org/javabip/executor/SpecificationParser.java | 2 +- .../src/main/java/org/javabip/spec/casino/Casino.java | 2 +- .../src/main/java/org/javabip/spec/casino/Operator.java | 2 +- .../src/main/java/org/javabip/spec/casino/Player.java | 2 +- .../main/java/org/javabip/spec/ringelection/ProcessSpec.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java b/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java index ca87e8c6..87330665 100644 --- a/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java +++ b/org.javabip.api/src/main/java/org/javabip/annotations/Invariant.java @@ -32,7 +32,7 @@ /** * expr is a string containing plain Java expressions * it must hold after construction of the component, can be assumed to hold before a transition, and must hold after a transition - * @return expr + * @return value */ - String expr(); + String value(); } diff --git a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java index 3231c398..f136fb64 100644 --- a/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java +++ b/org.javabip.executor/src/main/java/org/javabip/executor/SpecificationParser.java @@ -130,7 +130,7 @@ private BehaviourBuilder parseAnnotations(Class componentClass) throws BIPExc Invariant invariant = componentClass.getAnnotation(Invariant.class); if (invariant != null){ - builder.buildInvariant(invariant.expr()); + builder.buildInvariant(invariant.value()); } StatePredicates statePredicates = componentClass.getAnnotation(StatePredicates.class); diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java index 5dcc4f23..3fba848e 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Casino.java @@ -18,7 +18,7 @@ }) @ComponentType(initial = IDLE, name = CASINO_SPEC) -@Invariant(expr = "bet >= 0 && pot >= bet") +@Invariant("bet >= 0 && pot >= bet") @StatePredicates({ @StatePredicate(state = IDLE, expr = "false"), @StatePredicate(state = GAME_AVAILABLE, expr = "true"), diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java index c559350e..1c4d9897 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Operator.java @@ -17,7 +17,7 @@ }) @ComponentType(initial = WORKING, name = OPERATOR_SPEC) -@Invariant(expr = "pot >= 0") +@Invariant("pot >= 0") @StatePredicate(state = IDLE, expr = "pot == 0") public class Operator { final Integer id; diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java index 2fa4b82d..89c937d0 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/casino/Player.java @@ -13,7 +13,7 @@ }) @ComponentType(initial = GAME_AVAILABLE, name = PLAYER_SPEC) -@Invariant(expr = "bet <= purse") +@Invariant("bet <= purse") public class Player { final Integer id; Integer bet; diff --git a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java index 0e84f9e6..2ac538b9 100644 --- a/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java +++ b/org.javabip.spec.examples/src/main/java/org/javabip/spec/ringelection/ProcessSpec.java @@ -14,7 +14,7 @@ }) @ComponentType(initial = INITIAL, name = PROCESS) -@Invariant(expr = "isLeader == false || processID == 0") +@Invariant("isLeader == false || processID == 0") public class ProcessSpec { private int processID; private boolean isActive; From 0a455306111847746c4906c1c641ea5eb11ce487 Mon Sep 17 00:00:00 2001 From: lsafina Date: Thu, 8 Sep 2022 11:37:00 +0200 Subject: [PATCH 19/19] deleted --- .../verification/parser/JavaLexer.interp | 408 ------------ .../verification/parser/JavaLexer.java | 581 ------------------ .../verification/parser/JavaLexer.tokens | 242 -------- .../verification/parser/JavaParser.interp | 275 --------- .../verification/parser/JavaParser.tokens | 242 -------- .../parser/JavaParserBaseListener.java | 135 ---- .../parser/JavaParserBaseVisitor.java | 70 --- .../parser/JavaParserListener.java | 90 --- .../parser/JavaParserVisitor.java | 61 -- 9 files changed, 2104 deletions(-) delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java delete mode 100644 org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp deleted file mode 100644 index 18e0f528..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.interp +++ /dev/null @@ -1,408 +0,0 @@ -token literal names: -null -'abstract' -'assert' -'boolean' -'break' -'byte' -'case' -'catch' -'char' -'class' -'const' -'continue' -'default' -'do' -'double' -'else' -'enum' -'extends' -'final' -'finally' -'float' -'for' -'if' -'goto' -'implements' -'import' -'instanceof' -'int' -'interface' -'long' -'native' -'new' -'package' -'private' -'protected' -'public' -'return' -'short' -'static' -'strictfp' -'super' -'switch' -'synchronized' -'this' -'throw' -'throws' -'transient' -'try' -'void' -'volatile' -'while' -'module' -'open' -'requires' -'exports' -'opens' -'to' -'uses' -'provides' -'with' -'transitive' -'var' -'yield' -'record' -'sealed' -'permits' -'non-sealed' -null -null -null -null -null -null -null -null -null -null -'null' -'(' -')' -'{' -'}' -'[' -']' -';' -',' -'.' -'=' -'>' -'<' -'!' -'~' -'?' -':' -'==' -'<=' -'>=' -'!=' -'&&' -'||' -'++' -'--' -'+' -'-' -'*' -'/' -'&' -'|' -'^' -'%' -'+=' -'-=' -'*=' -'/=' -'&=' -'|=' -'^=' -'%=' -'<<=' -'>>=' -'>>>=' -'->' -'::' -'@' -'...' -null -null -null -null - -token symbolic names: -null -ABSTRACT -ASSERT -BOOLEAN -BREAK -BYTE -CASE -CATCH -CHAR -CLASS -CONST -CONTINUE -DEFAULT -DO -DOUBLE -ELSE -ENUM -EXTENDS -FINAL -FINALLY -FLOAT -FOR -IF -GOTO -IMPLEMENTS -IMPORT -INSTANCEOF -INT -INTERFACE -LONG -NATIVE -NEW -PACKAGE -PRIVATE -PROTECTED -PUBLIC -RETURN -SHORT -STATIC -STRICTFP -SUPER -SWITCH -SYNCHRONIZED -THIS -THROW -THROWS -TRANSIENT -TRY -VOID -VOLATILE -WHILE -MODULE -OPEN -REQUIRES -EXPORTS -OPENS -TO -USES -PROVIDES -WITH -TRANSITIVE -VAR -YIELD -RECORD -SEALED -PERMITS -NON_SEALED -DECIMAL_LITERAL -HEX_LITERAL -OCT_LITERAL -BINARY_LITERAL -FLOAT_LITERAL -HEX_FLOAT_LITERAL -BOOL_LITERAL -CHAR_LITERAL -STRING_LITERAL -TEXT_BLOCK -NULL_LITERAL -LPAREN -RPAREN -LBRACE -RBRACE -LBRACK -RBRACK -SEMI -COMMA -DOT -ASSIGN -GT -LT -BANG -TILDE -QUESTION -COLON -EQUAL -LE -GE -NOTEQUAL -AND -OR -INC -DEC -ADD -SUB -MUL -DIV -BITAND -BITOR -CARET -MOD -ADD_ASSIGN -SUB_ASSIGN -MUL_ASSIGN -DIV_ASSIGN -AND_ASSIGN -OR_ASSIGN -XOR_ASSIGN -MOD_ASSIGN -LSHIFT_ASSIGN -RSHIFT_ASSIGN -URSHIFT_ASSIGN -ARROW -COLONCOLON -AT -ELLIPSIS -WS -COMMENT -LINE_COMMENT -IDENTIFIER - -rule names: -ABSTRACT -ASSERT -BOOLEAN -BREAK -BYTE -CASE -CATCH -CHAR -CLASS -CONST -CONTINUE -DEFAULT -DO -DOUBLE -ELSE -ENUM -EXTENDS -FINAL -FINALLY -FLOAT -FOR -IF -GOTO -IMPLEMENTS -IMPORT -INSTANCEOF -INT -INTERFACE -LONG -NATIVE -NEW -PACKAGE -PRIVATE -PROTECTED -PUBLIC -RETURN -SHORT -STATIC -STRICTFP -SUPER -SWITCH -SYNCHRONIZED -THIS -THROW -THROWS -TRANSIENT -TRY -VOID -VOLATILE -WHILE -MODULE -OPEN -REQUIRES -EXPORTS -OPENS -TO -USES -PROVIDES -WITH -TRANSITIVE -VAR -YIELD -RECORD -SEALED -PERMITS -NON_SEALED -DECIMAL_LITERAL -HEX_LITERAL -OCT_LITERAL -BINARY_LITERAL -FLOAT_LITERAL -HEX_FLOAT_LITERAL -BOOL_LITERAL -CHAR_LITERAL -STRING_LITERAL -TEXT_BLOCK -NULL_LITERAL -LPAREN -RPAREN -LBRACE -RBRACE -LBRACK -RBRACK -SEMI -COMMA -DOT -ASSIGN -GT -LT -BANG -TILDE -QUESTION -COLON -EQUAL -LE -GE -NOTEQUAL -AND -OR -INC -DEC -ADD -SUB -MUL -DIV -BITAND -BITOR -CARET -MOD -ADD_ASSIGN -SUB_ASSIGN -MUL_ASSIGN -DIV_ASSIGN -AND_ASSIGN -OR_ASSIGN -XOR_ASSIGN -MOD_ASSIGN -LSHIFT_ASSIGN -RSHIFT_ASSIGN -URSHIFT_ASSIGN -ARROW -COLONCOLON -AT -ELLIPSIS -WS -COMMENT -LINE_COMMENT -IDENTIFIER -ExponentPart -EscapeSequence -HexDigits -HexDigit -Digits -LetterOrDigit -Letter - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 130, 1114, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 4, 120, 9, 120, 4, 121, 9, 121, 4, 122, 9, 122, 4, 123, 9, 123, 4, 124, 9, 124, 4, 125, 9, 125, 4, 126, 9, 126, 4, 127, 9, 127, 4, 128, 9, 128, 4, 129, 9, 129, 4, 130, 9, 130, 4, 131, 9, 131, 4, 132, 9, 132, 4, 133, 9, 133, 4, 134, 9, 134, 4, 135, 9, 135, 4, 136, 9, 136, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 5, 68, 727, 10, 68, 3, 68, 6, 68, 730, 10, 68, 13, 68, 14, 68, 731, 3, 68, 5, 68, 735, 10, 68, 5, 68, 737, 10, 68, 3, 68, 5, 68, 740, 10, 68, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 746, 10, 69, 12, 69, 14, 69, 749, 11, 69, 3, 69, 5, 69, 752, 10, 69, 3, 69, 5, 69, 755, 10, 69, 3, 70, 3, 70, 7, 70, 759, 10, 70, 12, 70, 14, 70, 762, 11, 70, 3, 70, 3, 70, 7, 70, 766, 10, 70, 12, 70, 14, 70, 769, 11, 70, 3, 70, 5, 70, 772, 10, 70, 3, 70, 5, 70, 775, 10, 70, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 781, 10, 71, 12, 71, 14, 71, 784, 11, 71, 3, 71, 5, 71, 787, 10, 71, 3, 71, 5, 71, 790, 10, 71, 3, 72, 3, 72, 3, 72, 5, 72, 795, 10, 72, 3, 72, 3, 72, 5, 72, 799, 10, 72, 3, 72, 5, 72, 802, 10, 72, 3, 72, 5, 72, 805, 10, 72, 3, 72, 3, 72, 3, 72, 5, 72, 810, 10, 72, 3, 72, 5, 72, 813, 10, 72, 5, 72, 815, 10, 72, 3, 73, 3, 73, 3, 73, 3, 73, 5, 73, 821, 10, 73, 3, 73, 5, 73, 824, 10, 73, 3, 73, 3, 73, 5, 73, 828, 10, 73, 3, 73, 3, 73, 5, 73, 832, 10, 73, 3, 73, 3, 73, 5, 73, 836, 10, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 847, 10, 74, 3, 75, 3, 75, 3, 75, 5, 75, 852, 10, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 7, 76, 859, 10, 76, 12, 76, 14, 76, 862, 11, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 871, 10, 77, 12, 77, 14, 77, 874, 11, 77, 3, 77, 3, 77, 3, 77, 7, 77, 879, 10, 77, 12, 77, 14, 77, 882, 11, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 3, 93, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 104, 3, 104, 3, 105, 3, 105, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 113, 3, 113, 3, 113, 3, 114, 3, 114, 3, 114, 3, 115, 3, 115, 3, 115, 3, 116, 3, 116, 3, 116, 3, 117, 3, 117, 3, 117, 3, 118, 3, 118, 3, 118, 3, 119, 3, 119, 3, 119, 3, 119, 3, 120, 3, 120, 3, 120, 3, 120, 3, 121, 3, 121, 3, 121, 3, 121, 3, 121, 3, 122, 3, 122, 3, 122, 3, 123, 3, 123, 3, 123, 3, 124, 3, 124, 3, 125, 3, 125, 3, 125, 3, 125, 3, 126, 6, 126, 1015, 10, 126, 13, 126, 14, 126, 1016, 3, 126, 3, 126, 3, 127, 3, 127, 3, 127, 3, 127, 7, 127, 1025, 10, 127, 12, 127, 14, 127, 1028, 11, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 127, 3, 128, 3, 128, 3, 128, 3, 128, 7, 128, 1039, 10, 128, 12, 128, 14, 128, 1042, 11, 128, 3, 128, 3, 128, 3, 129, 3, 129, 7, 129, 1048, 10, 129, 12, 129, 14, 129, 1051, 11, 129, 3, 130, 3, 130, 5, 130, 1055, 10, 130, 3, 130, 3, 130, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1063, 10, 131, 3, 131, 5, 131, 1066, 10, 131, 3, 131, 3, 131, 3, 131, 6, 131, 1071, 10, 131, 13, 131, 14, 131, 1072, 3, 131, 3, 131, 3, 131, 3, 131, 3, 131, 5, 131, 1080, 10, 131, 3, 132, 3, 132, 3, 132, 7, 132, 1085, 10, 132, 12, 132, 14, 132, 1088, 11, 132, 3, 132, 5, 132, 1091, 10, 132, 3, 133, 3, 133, 3, 134, 3, 134, 7, 134, 1097, 10, 134, 12, 134, 14, 134, 1100, 11, 134, 3, 134, 5, 134, 1103, 10, 134, 3, 135, 3, 135, 5, 135, 1107, 10, 135, 3, 136, 3, 136, 3, 136, 3, 136, 5, 136, 1113, 10, 136, 4, 880, 1026, 2, 137, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 75, 149, 76, 151, 77, 153, 78, 155, 79, 157, 80, 159, 81, 161, 82, 163, 83, 165, 84, 167, 85, 169, 86, 171, 87, 173, 88, 175, 89, 177, 90, 179, 91, 181, 92, 183, 93, 185, 94, 187, 95, 189, 96, 191, 97, 193, 98, 195, 99, 197, 100, 199, 101, 201, 102, 203, 103, 205, 104, 207, 105, 209, 106, 211, 107, 213, 108, 215, 109, 217, 110, 219, 111, 221, 112, 223, 113, 225, 114, 227, 115, 229, 116, 231, 117, 233, 118, 235, 119, 237, 120, 239, 121, 241, 122, 243, 123, 245, 124, 247, 125, 249, 126, 251, 127, 253, 128, 255, 129, 257, 130, 259, 2, 261, 2, 263, 2, 265, 2, 267, 2, 269, 2, 271, 2, 3, 2, 29, 3, 2, 51, 59, 4, 2, 78, 78, 110, 110, 4, 2, 90, 90, 122, 122, 5, 2, 50, 59, 67, 72, 99, 104, 6, 2, 50, 59, 67, 72, 97, 97, 99, 104, 3, 2, 50, 57, 4, 2, 50, 57, 97, 97, 4, 2, 68, 68, 100, 100, 3, 2, 50, 51, 4, 2, 50, 51, 97, 97, 6, 2, 70, 70, 72, 72, 102, 102, 104, 104, 4, 2, 82, 82, 114, 114, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 11, 11, 34, 34, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 71, 71, 103, 103, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97, 99, 124, 4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345, 2, 1158, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 2, 165, 3, 2, 2, 2, 2, 167, 3, 2, 2, 2, 2, 169, 3, 2, 2, 2, 2, 171, 3, 2, 2, 2, 2, 173, 3, 2, 2, 2, 2, 175, 3, 2, 2, 2, 2, 177, 3, 2, 2, 2, 2, 179, 3, 2, 2, 2, 2, 181, 3, 2, 2, 2, 2, 183, 3, 2, 2, 2, 2, 185, 3, 2, 2, 2, 2, 187, 3, 2, 2, 2, 2, 189, 3, 2, 2, 2, 2, 191, 3, 2, 2, 2, 2, 193, 3, 2, 2, 2, 2, 195, 3, 2, 2, 2, 2, 197, 3, 2, 2, 2, 2, 199, 3, 2, 2, 2, 2, 201, 3, 2, 2, 2, 2, 203, 3, 2, 2, 2, 2, 205, 3, 2, 2, 2, 2, 207, 3, 2, 2, 2, 2, 209, 3, 2, 2, 2, 2, 211, 3, 2, 2, 2, 2, 213, 3, 2, 2, 2, 2, 215, 3, 2, 2, 2, 2, 217, 3, 2, 2, 2, 2, 219, 3, 2, 2, 2, 2, 221, 3, 2, 2, 2, 2, 223, 3, 2, 2, 2, 2, 225, 3, 2, 2, 2, 2, 227, 3, 2, 2, 2, 2, 229, 3, 2, 2, 2, 2, 231, 3, 2, 2, 2, 2, 233, 3, 2, 2, 2, 2, 235, 3, 2, 2, 2, 2, 237, 3, 2, 2, 2, 2, 239, 3, 2, 2, 2, 2, 241, 3, 2, 2, 2, 2, 243, 3, 2, 2, 2, 2, 245, 3, 2, 2, 2, 2, 247, 3, 2, 2, 2, 2, 249, 3, 2, 2, 2, 2, 251, 3, 2, 2, 2, 2, 253, 3, 2, 2, 2, 2, 255, 3, 2, 2, 2, 2, 257, 3, 2, 2, 2, 3, 273, 3, 2, 2, 2, 5, 282, 3, 2, 2, 2, 7, 289, 3, 2, 2, 2, 9, 297, 3, 2, 2, 2, 11, 303, 3, 2, 2, 2, 13, 308, 3, 2, 2, 2, 15, 313, 3, 2, 2, 2, 17, 319, 3, 2, 2, 2, 19, 324, 3, 2, 2, 2, 21, 330, 3, 2, 2, 2, 23, 336, 3, 2, 2, 2, 25, 345, 3, 2, 2, 2, 27, 353, 3, 2, 2, 2, 29, 356, 3, 2, 2, 2, 31, 363, 3, 2, 2, 2, 33, 368, 3, 2, 2, 2, 35, 373, 3, 2, 2, 2, 37, 381, 3, 2, 2, 2, 39, 387, 3, 2, 2, 2, 41, 395, 3, 2, 2, 2, 43, 401, 3, 2, 2, 2, 45, 405, 3, 2, 2, 2, 47, 408, 3, 2, 2, 2, 49, 413, 3, 2, 2, 2, 51, 424, 3, 2, 2, 2, 53, 431, 3, 2, 2, 2, 55, 442, 3, 2, 2, 2, 57, 446, 3, 2, 2, 2, 59, 456, 3, 2, 2, 2, 61, 461, 3, 2, 2, 2, 63, 468, 3, 2, 2, 2, 65, 472, 3, 2, 2, 2, 67, 480, 3, 2, 2, 2, 69, 488, 3, 2, 2, 2, 71, 498, 3, 2, 2, 2, 73, 505, 3, 2, 2, 2, 75, 512, 3, 2, 2, 2, 77, 518, 3, 2, 2, 2, 79, 525, 3, 2, 2, 2, 81, 534, 3, 2, 2, 2, 83, 540, 3, 2, 2, 2, 85, 547, 3, 2, 2, 2, 87, 560, 3, 2, 2, 2, 89, 565, 3, 2, 2, 2, 91, 571, 3, 2, 2, 2, 93, 578, 3, 2, 2, 2, 95, 588, 3, 2, 2, 2, 97, 592, 3, 2, 2, 2, 99, 597, 3, 2, 2, 2, 101, 606, 3, 2, 2, 2, 103, 612, 3, 2, 2, 2, 105, 619, 3, 2, 2, 2, 107, 624, 3, 2, 2, 2, 109, 633, 3, 2, 2, 2, 111, 641, 3, 2, 2, 2, 113, 647, 3, 2, 2, 2, 115, 650, 3, 2, 2, 2, 117, 655, 3, 2, 2, 2, 119, 664, 3, 2, 2, 2, 121, 669, 3, 2, 2, 2, 123, 680, 3, 2, 2, 2, 125, 684, 3, 2, 2, 2, 127, 690, 3, 2, 2, 2, 129, 697, 3, 2, 2, 2, 131, 704, 3, 2, 2, 2, 133, 712, 3, 2, 2, 2, 135, 736, 3, 2, 2, 2, 137, 741, 3, 2, 2, 2, 139, 756, 3, 2, 2, 2, 141, 776, 3, 2, 2, 2, 143, 814, 3, 2, 2, 2, 145, 816, 3, 2, 2, 2, 147, 846, 3, 2, 2, 2, 149, 848, 3, 2, 2, 2, 151, 855, 3, 2, 2, 2, 153, 865, 3, 2, 2, 2, 155, 887, 3, 2, 2, 2, 157, 892, 3, 2, 2, 2, 159, 894, 3, 2, 2, 2, 161, 896, 3, 2, 2, 2, 163, 898, 3, 2, 2, 2, 165, 900, 3, 2, 2, 2, 167, 902, 3, 2, 2, 2, 169, 904, 3, 2, 2, 2, 171, 906, 3, 2, 2, 2, 173, 908, 3, 2, 2, 2, 175, 910, 3, 2, 2, 2, 177, 912, 3, 2, 2, 2, 179, 914, 3, 2, 2, 2, 181, 916, 3, 2, 2, 2, 183, 918, 3, 2, 2, 2, 185, 920, 3, 2, 2, 2, 187, 922, 3, 2, 2, 2, 189, 924, 3, 2, 2, 2, 191, 927, 3, 2, 2, 2, 193, 930, 3, 2, 2, 2, 195, 933, 3, 2, 2, 2, 197, 936, 3, 2, 2, 2, 199, 939, 3, 2, 2, 2, 201, 942, 3, 2, 2, 2, 203, 945, 3, 2, 2, 2, 205, 948, 3, 2, 2, 2, 207, 950, 3, 2, 2, 2, 209, 952, 3, 2, 2, 2, 211, 954, 3, 2, 2, 2, 213, 956, 3, 2, 2, 2, 215, 958, 3, 2, 2, 2, 217, 960, 3, 2, 2, 2, 219, 962, 3, 2, 2, 2, 221, 964, 3, 2, 2, 2, 223, 967, 3, 2, 2, 2, 225, 970, 3, 2, 2, 2, 227, 973, 3, 2, 2, 2, 229, 976, 3, 2, 2, 2, 231, 979, 3, 2, 2, 2, 233, 982, 3, 2, 2, 2, 235, 985, 3, 2, 2, 2, 237, 988, 3, 2, 2, 2, 239, 992, 3, 2, 2, 2, 241, 996, 3, 2, 2, 2, 243, 1001, 3, 2, 2, 2, 245, 1004, 3, 2, 2, 2, 247, 1007, 3, 2, 2, 2, 249, 1009, 3, 2, 2, 2, 251, 1014, 3, 2, 2, 2, 253, 1020, 3, 2, 2, 2, 255, 1034, 3, 2, 2, 2, 257, 1045, 3, 2, 2, 2, 259, 1052, 3, 2, 2, 2, 261, 1079, 3, 2, 2, 2, 263, 1081, 3, 2, 2, 2, 265, 1092, 3, 2, 2, 2, 267, 1094, 3, 2, 2, 2, 269, 1106, 3, 2, 2, 2, 271, 1112, 3, 2, 2, 2, 273, 274, 7, 99, 2, 2, 274, 275, 7, 100, 2, 2, 275, 276, 7, 117, 2, 2, 276, 277, 7, 118, 2, 2, 277, 278, 7, 116, 2, 2, 278, 279, 7, 99, 2, 2, 279, 280, 7, 101, 2, 2, 280, 281, 7, 118, 2, 2, 281, 4, 3, 2, 2, 2, 282, 283, 7, 99, 2, 2, 283, 284, 7, 117, 2, 2, 284, 285, 7, 117, 2, 2, 285, 286, 7, 103, 2, 2, 286, 287, 7, 116, 2, 2, 287, 288, 7, 118, 2, 2, 288, 6, 3, 2, 2, 2, 289, 290, 7, 100, 2, 2, 290, 291, 7, 113, 2, 2, 291, 292, 7, 113, 2, 2, 292, 293, 7, 110, 2, 2, 293, 294, 7, 103, 2, 2, 294, 295, 7, 99, 2, 2, 295, 296, 7, 112, 2, 2, 296, 8, 3, 2, 2, 2, 297, 298, 7, 100, 2, 2, 298, 299, 7, 116, 2, 2, 299, 300, 7, 103, 2, 2, 300, 301, 7, 99, 2, 2, 301, 302, 7, 109, 2, 2, 302, 10, 3, 2, 2, 2, 303, 304, 7, 100, 2, 2, 304, 305, 7, 123, 2, 2, 305, 306, 7, 118, 2, 2, 306, 307, 7, 103, 2, 2, 307, 12, 3, 2, 2, 2, 308, 309, 7, 101, 2, 2, 309, 310, 7, 99, 2, 2, 310, 311, 7, 117, 2, 2, 311, 312, 7, 103, 2, 2, 312, 14, 3, 2, 2, 2, 313, 314, 7, 101, 2, 2, 314, 315, 7, 99, 2, 2, 315, 316, 7, 118, 2, 2, 316, 317, 7, 101, 2, 2, 317, 318, 7, 106, 2, 2, 318, 16, 3, 2, 2, 2, 319, 320, 7, 101, 2, 2, 320, 321, 7, 106, 2, 2, 321, 322, 7, 99, 2, 2, 322, 323, 7, 116, 2, 2, 323, 18, 3, 2, 2, 2, 324, 325, 7, 101, 2, 2, 325, 326, 7, 110, 2, 2, 326, 327, 7, 99, 2, 2, 327, 328, 7, 117, 2, 2, 328, 329, 7, 117, 2, 2, 329, 20, 3, 2, 2, 2, 330, 331, 7, 101, 2, 2, 331, 332, 7, 113, 2, 2, 332, 333, 7, 112, 2, 2, 333, 334, 7, 117, 2, 2, 334, 335, 7, 118, 2, 2, 335, 22, 3, 2, 2, 2, 336, 337, 7, 101, 2, 2, 337, 338, 7, 113, 2, 2, 338, 339, 7, 112, 2, 2, 339, 340, 7, 118, 2, 2, 340, 341, 7, 107, 2, 2, 341, 342, 7, 112, 2, 2, 342, 343, 7, 119, 2, 2, 343, 344, 7, 103, 2, 2, 344, 24, 3, 2, 2, 2, 345, 346, 7, 102, 2, 2, 346, 347, 7, 103, 2, 2, 347, 348, 7, 104, 2, 2, 348, 349, 7, 99, 2, 2, 349, 350, 7, 119, 2, 2, 350, 351, 7, 110, 2, 2, 351, 352, 7, 118, 2, 2, 352, 26, 3, 2, 2, 2, 353, 354, 7, 102, 2, 2, 354, 355, 7, 113, 2, 2, 355, 28, 3, 2, 2, 2, 356, 357, 7, 102, 2, 2, 357, 358, 7, 113, 2, 2, 358, 359, 7, 119, 2, 2, 359, 360, 7, 100, 2, 2, 360, 361, 7, 110, 2, 2, 361, 362, 7, 103, 2, 2, 362, 30, 3, 2, 2, 2, 363, 364, 7, 103, 2, 2, 364, 365, 7, 110, 2, 2, 365, 366, 7, 117, 2, 2, 366, 367, 7, 103, 2, 2, 367, 32, 3, 2, 2, 2, 368, 369, 7, 103, 2, 2, 369, 370, 7, 112, 2, 2, 370, 371, 7, 119, 2, 2, 371, 372, 7, 111, 2, 2, 372, 34, 3, 2, 2, 2, 373, 374, 7, 103, 2, 2, 374, 375, 7, 122, 2, 2, 375, 376, 7, 118, 2, 2, 376, 377, 7, 103, 2, 2, 377, 378, 7, 112, 2, 2, 378, 379, 7, 102, 2, 2, 379, 380, 7, 117, 2, 2, 380, 36, 3, 2, 2, 2, 381, 382, 7, 104, 2, 2, 382, 383, 7, 107, 2, 2, 383, 384, 7, 112, 2, 2, 384, 385, 7, 99, 2, 2, 385, 386, 7, 110, 2, 2, 386, 38, 3, 2, 2, 2, 387, 388, 7, 104, 2, 2, 388, 389, 7, 107, 2, 2, 389, 390, 7, 112, 2, 2, 390, 391, 7, 99, 2, 2, 391, 392, 7, 110, 2, 2, 392, 393, 7, 110, 2, 2, 393, 394, 7, 123, 2, 2, 394, 40, 3, 2, 2, 2, 395, 396, 7, 104, 2, 2, 396, 397, 7, 110, 2, 2, 397, 398, 7, 113, 2, 2, 398, 399, 7, 99, 2, 2, 399, 400, 7, 118, 2, 2, 400, 42, 3, 2, 2, 2, 401, 402, 7, 104, 2, 2, 402, 403, 7, 113, 2, 2, 403, 404, 7, 116, 2, 2, 404, 44, 3, 2, 2, 2, 405, 406, 7, 107, 2, 2, 406, 407, 7, 104, 2, 2, 407, 46, 3, 2, 2, 2, 408, 409, 7, 105, 2, 2, 409, 410, 7, 113, 2, 2, 410, 411, 7, 118, 2, 2, 411, 412, 7, 113, 2, 2, 412, 48, 3, 2, 2, 2, 413, 414, 7, 107, 2, 2, 414, 415, 7, 111, 2, 2, 415, 416, 7, 114, 2, 2, 416, 417, 7, 110, 2, 2, 417, 418, 7, 103, 2, 2, 418, 419, 7, 111, 2, 2, 419, 420, 7, 103, 2, 2, 420, 421, 7, 112, 2, 2, 421, 422, 7, 118, 2, 2, 422, 423, 7, 117, 2, 2, 423, 50, 3, 2, 2, 2, 424, 425, 7, 107, 2, 2, 425, 426, 7, 111, 2, 2, 426, 427, 7, 114, 2, 2, 427, 428, 7, 113, 2, 2, 428, 429, 7, 116, 2, 2, 429, 430, 7, 118, 2, 2, 430, 52, 3, 2, 2, 2, 431, 432, 7, 107, 2, 2, 432, 433, 7, 112, 2, 2, 433, 434, 7, 117, 2, 2, 434, 435, 7, 118, 2, 2, 435, 436, 7, 99, 2, 2, 436, 437, 7, 112, 2, 2, 437, 438, 7, 101, 2, 2, 438, 439, 7, 103, 2, 2, 439, 440, 7, 113, 2, 2, 440, 441, 7, 104, 2, 2, 441, 54, 3, 2, 2, 2, 442, 443, 7, 107, 2, 2, 443, 444, 7, 112, 2, 2, 444, 445, 7, 118, 2, 2, 445, 56, 3, 2, 2, 2, 446, 447, 7, 107, 2, 2, 447, 448, 7, 112, 2, 2, 448, 449, 7, 118, 2, 2, 449, 450, 7, 103, 2, 2, 450, 451, 7, 116, 2, 2, 451, 452, 7, 104, 2, 2, 452, 453, 7, 99, 2, 2, 453, 454, 7, 101, 2, 2, 454, 455, 7, 103, 2, 2, 455, 58, 3, 2, 2, 2, 456, 457, 7, 110, 2, 2, 457, 458, 7, 113, 2, 2, 458, 459, 7, 112, 2, 2, 459, 460, 7, 105, 2, 2, 460, 60, 3, 2, 2, 2, 461, 462, 7, 112, 2, 2, 462, 463, 7, 99, 2, 2, 463, 464, 7, 118, 2, 2, 464, 465, 7, 107, 2, 2, 465, 466, 7, 120, 2, 2, 466, 467, 7, 103, 2, 2, 467, 62, 3, 2, 2, 2, 468, 469, 7, 112, 2, 2, 469, 470, 7, 103, 2, 2, 470, 471, 7, 121, 2, 2, 471, 64, 3, 2, 2, 2, 472, 473, 7, 114, 2, 2, 473, 474, 7, 99, 2, 2, 474, 475, 7, 101, 2, 2, 475, 476, 7, 109, 2, 2, 476, 477, 7, 99, 2, 2, 477, 478, 7, 105, 2, 2, 478, 479, 7, 103, 2, 2, 479, 66, 3, 2, 2, 2, 480, 481, 7, 114, 2, 2, 481, 482, 7, 116, 2, 2, 482, 483, 7, 107, 2, 2, 483, 484, 7, 120, 2, 2, 484, 485, 7, 99, 2, 2, 485, 486, 7, 118, 2, 2, 486, 487, 7, 103, 2, 2, 487, 68, 3, 2, 2, 2, 488, 489, 7, 114, 2, 2, 489, 490, 7, 116, 2, 2, 490, 491, 7, 113, 2, 2, 491, 492, 7, 118, 2, 2, 492, 493, 7, 103, 2, 2, 493, 494, 7, 101, 2, 2, 494, 495, 7, 118, 2, 2, 495, 496, 7, 103, 2, 2, 496, 497, 7, 102, 2, 2, 497, 70, 3, 2, 2, 2, 498, 499, 7, 114, 2, 2, 499, 500, 7, 119, 2, 2, 500, 501, 7, 100, 2, 2, 501, 502, 7, 110, 2, 2, 502, 503, 7, 107, 2, 2, 503, 504, 7, 101, 2, 2, 504, 72, 3, 2, 2, 2, 505, 506, 7, 116, 2, 2, 506, 507, 7, 103, 2, 2, 507, 508, 7, 118, 2, 2, 508, 509, 7, 119, 2, 2, 509, 510, 7, 116, 2, 2, 510, 511, 7, 112, 2, 2, 511, 74, 3, 2, 2, 2, 512, 513, 7, 117, 2, 2, 513, 514, 7, 106, 2, 2, 514, 515, 7, 113, 2, 2, 515, 516, 7, 116, 2, 2, 516, 517, 7, 118, 2, 2, 517, 76, 3, 2, 2, 2, 518, 519, 7, 117, 2, 2, 519, 520, 7, 118, 2, 2, 520, 521, 7, 99, 2, 2, 521, 522, 7, 118, 2, 2, 522, 523, 7, 107, 2, 2, 523, 524, 7, 101, 2, 2, 524, 78, 3, 2, 2, 2, 525, 526, 7, 117, 2, 2, 526, 527, 7, 118, 2, 2, 527, 528, 7, 116, 2, 2, 528, 529, 7, 107, 2, 2, 529, 530, 7, 101, 2, 2, 530, 531, 7, 118, 2, 2, 531, 532, 7, 104, 2, 2, 532, 533, 7, 114, 2, 2, 533, 80, 3, 2, 2, 2, 534, 535, 7, 117, 2, 2, 535, 536, 7, 119, 2, 2, 536, 537, 7, 114, 2, 2, 537, 538, 7, 103, 2, 2, 538, 539, 7, 116, 2, 2, 539, 82, 3, 2, 2, 2, 540, 541, 7, 117, 2, 2, 541, 542, 7, 121, 2, 2, 542, 543, 7, 107, 2, 2, 543, 544, 7, 118, 2, 2, 544, 545, 7, 101, 2, 2, 545, 546, 7, 106, 2, 2, 546, 84, 3, 2, 2, 2, 547, 548, 7, 117, 2, 2, 548, 549, 7, 123, 2, 2, 549, 550, 7, 112, 2, 2, 550, 551, 7, 101, 2, 2, 551, 552, 7, 106, 2, 2, 552, 553, 7, 116, 2, 2, 553, 554, 7, 113, 2, 2, 554, 555, 7, 112, 2, 2, 555, 556, 7, 107, 2, 2, 556, 557, 7, 124, 2, 2, 557, 558, 7, 103, 2, 2, 558, 559, 7, 102, 2, 2, 559, 86, 3, 2, 2, 2, 560, 561, 7, 118, 2, 2, 561, 562, 7, 106, 2, 2, 562, 563, 7, 107, 2, 2, 563, 564, 7, 117, 2, 2, 564, 88, 3, 2, 2, 2, 565, 566, 7, 118, 2, 2, 566, 567, 7, 106, 2, 2, 567, 568, 7, 116, 2, 2, 568, 569, 7, 113, 2, 2, 569, 570, 7, 121, 2, 2, 570, 90, 3, 2, 2, 2, 571, 572, 7, 118, 2, 2, 572, 573, 7, 106, 2, 2, 573, 574, 7, 116, 2, 2, 574, 575, 7, 113, 2, 2, 575, 576, 7, 121, 2, 2, 576, 577, 7, 117, 2, 2, 577, 92, 3, 2, 2, 2, 578, 579, 7, 118, 2, 2, 579, 580, 7, 116, 2, 2, 580, 581, 7, 99, 2, 2, 581, 582, 7, 112, 2, 2, 582, 583, 7, 117, 2, 2, 583, 584, 7, 107, 2, 2, 584, 585, 7, 103, 2, 2, 585, 586, 7, 112, 2, 2, 586, 587, 7, 118, 2, 2, 587, 94, 3, 2, 2, 2, 588, 589, 7, 118, 2, 2, 589, 590, 7, 116, 2, 2, 590, 591, 7, 123, 2, 2, 591, 96, 3, 2, 2, 2, 592, 593, 7, 120, 2, 2, 593, 594, 7, 113, 2, 2, 594, 595, 7, 107, 2, 2, 595, 596, 7, 102, 2, 2, 596, 98, 3, 2, 2, 2, 597, 598, 7, 120, 2, 2, 598, 599, 7, 113, 2, 2, 599, 600, 7, 110, 2, 2, 600, 601, 7, 99, 2, 2, 601, 602, 7, 118, 2, 2, 602, 603, 7, 107, 2, 2, 603, 604, 7, 110, 2, 2, 604, 605, 7, 103, 2, 2, 605, 100, 3, 2, 2, 2, 606, 607, 7, 121, 2, 2, 607, 608, 7, 106, 2, 2, 608, 609, 7, 107, 2, 2, 609, 610, 7, 110, 2, 2, 610, 611, 7, 103, 2, 2, 611, 102, 3, 2, 2, 2, 612, 613, 7, 111, 2, 2, 613, 614, 7, 113, 2, 2, 614, 615, 7, 102, 2, 2, 615, 616, 7, 119, 2, 2, 616, 617, 7, 110, 2, 2, 617, 618, 7, 103, 2, 2, 618, 104, 3, 2, 2, 2, 619, 620, 7, 113, 2, 2, 620, 621, 7, 114, 2, 2, 621, 622, 7, 103, 2, 2, 622, 623, 7, 112, 2, 2, 623, 106, 3, 2, 2, 2, 624, 625, 7, 116, 2, 2, 625, 626, 7, 103, 2, 2, 626, 627, 7, 115, 2, 2, 627, 628, 7, 119, 2, 2, 628, 629, 7, 107, 2, 2, 629, 630, 7, 116, 2, 2, 630, 631, 7, 103, 2, 2, 631, 632, 7, 117, 2, 2, 632, 108, 3, 2, 2, 2, 633, 634, 7, 103, 2, 2, 634, 635, 7, 122, 2, 2, 635, 636, 7, 114, 2, 2, 636, 637, 7, 113, 2, 2, 637, 638, 7, 116, 2, 2, 638, 639, 7, 118, 2, 2, 639, 640, 7, 117, 2, 2, 640, 110, 3, 2, 2, 2, 641, 642, 7, 113, 2, 2, 642, 643, 7, 114, 2, 2, 643, 644, 7, 103, 2, 2, 644, 645, 7, 112, 2, 2, 645, 646, 7, 117, 2, 2, 646, 112, 3, 2, 2, 2, 647, 648, 7, 118, 2, 2, 648, 649, 7, 113, 2, 2, 649, 114, 3, 2, 2, 2, 650, 651, 7, 119, 2, 2, 651, 652, 7, 117, 2, 2, 652, 653, 7, 103, 2, 2, 653, 654, 7, 117, 2, 2, 654, 116, 3, 2, 2, 2, 655, 656, 7, 114, 2, 2, 656, 657, 7, 116, 2, 2, 657, 658, 7, 113, 2, 2, 658, 659, 7, 120, 2, 2, 659, 660, 7, 107, 2, 2, 660, 661, 7, 102, 2, 2, 661, 662, 7, 103, 2, 2, 662, 663, 7, 117, 2, 2, 663, 118, 3, 2, 2, 2, 664, 665, 7, 121, 2, 2, 665, 666, 7, 107, 2, 2, 666, 667, 7, 118, 2, 2, 667, 668, 7, 106, 2, 2, 668, 120, 3, 2, 2, 2, 669, 670, 7, 118, 2, 2, 670, 671, 7, 116, 2, 2, 671, 672, 7, 99, 2, 2, 672, 673, 7, 112, 2, 2, 673, 674, 7, 117, 2, 2, 674, 675, 7, 107, 2, 2, 675, 676, 7, 118, 2, 2, 676, 677, 7, 107, 2, 2, 677, 678, 7, 120, 2, 2, 678, 679, 7, 103, 2, 2, 679, 122, 3, 2, 2, 2, 680, 681, 7, 120, 2, 2, 681, 682, 7, 99, 2, 2, 682, 683, 7, 116, 2, 2, 683, 124, 3, 2, 2, 2, 684, 685, 7, 123, 2, 2, 685, 686, 7, 107, 2, 2, 686, 687, 7, 103, 2, 2, 687, 688, 7, 110, 2, 2, 688, 689, 7, 102, 2, 2, 689, 126, 3, 2, 2, 2, 690, 691, 7, 116, 2, 2, 691, 692, 7, 103, 2, 2, 692, 693, 7, 101, 2, 2, 693, 694, 7, 113, 2, 2, 694, 695, 7, 116, 2, 2, 695, 696, 7, 102, 2, 2, 696, 128, 3, 2, 2, 2, 697, 698, 7, 117, 2, 2, 698, 699, 7, 103, 2, 2, 699, 700, 7, 99, 2, 2, 700, 701, 7, 110, 2, 2, 701, 702, 7, 103, 2, 2, 702, 703, 7, 102, 2, 2, 703, 130, 3, 2, 2, 2, 704, 705, 7, 114, 2, 2, 705, 706, 7, 103, 2, 2, 706, 707, 7, 116, 2, 2, 707, 708, 7, 111, 2, 2, 708, 709, 7, 107, 2, 2, 709, 710, 7, 118, 2, 2, 710, 711, 7, 117, 2, 2, 711, 132, 3, 2, 2, 2, 712, 713, 7, 112, 2, 2, 713, 714, 7, 113, 2, 2, 714, 715, 7, 112, 2, 2, 715, 716, 7, 47, 2, 2, 716, 717, 7, 117, 2, 2, 717, 718, 7, 103, 2, 2, 718, 719, 7, 99, 2, 2, 719, 720, 7, 110, 2, 2, 720, 721, 7, 103, 2, 2, 721, 722, 7, 102, 2, 2, 722, 134, 3, 2, 2, 2, 723, 737, 7, 50, 2, 2, 724, 734, 9, 2, 2, 2, 725, 727, 5, 267, 134, 2, 726, 725, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 735, 3, 2, 2, 2, 728, 730, 7, 97, 2, 2, 729, 728, 3, 2, 2, 2, 730, 731, 3, 2, 2, 2, 731, 729, 3, 2, 2, 2, 731, 732, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, 735, 5, 267, 134, 2, 734, 726, 3, 2, 2, 2, 734, 729, 3, 2, 2, 2, 735, 737, 3, 2, 2, 2, 736, 723, 3, 2, 2, 2, 736, 724, 3, 2, 2, 2, 737, 739, 3, 2, 2, 2, 738, 740, 9, 3, 2, 2, 739, 738, 3, 2, 2, 2, 739, 740, 3, 2, 2, 2, 740, 136, 3, 2, 2, 2, 741, 742, 7, 50, 2, 2, 742, 743, 9, 4, 2, 2, 743, 751, 9, 5, 2, 2, 744, 746, 9, 6, 2, 2, 745, 744, 3, 2, 2, 2, 746, 749, 3, 2, 2, 2, 747, 745, 3, 2, 2, 2, 747, 748, 3, 2, 2, 2, 748, 750, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 750, 752, 9, 5, 2, 2, 751, 747, 3, 2, 2, 2, 751, 752, 3, 2, 2, 2, 752, 754, 3, 2, 2, 2, 753, 755, 9, 3, 2, 2, 754, 753, 3, 2, 2, 2, 754, 755, 3, 2, 2, 2, 755, 138, 3, 2, 2, 2, 756, 760, 7, 50, 2, 2, 757, 759, 7, 97, 2, 2, 758, 757, 3, 2, 2, 2, 759, 762, 3, 2, 2, 2, 760, 758, 3, 2, 2, 2, 760, 761, 3, 2, 2, 2, 761, 763, 3, 2, 2, 2, 762, 760, 3, 2, 2, 2, 763, 771, 9, 7, 2, 2, 764, 766, 9, 8, 2, 2, 765, 764, 3, 2, 2, 2, 766, 769, 3, 2, 2, 2, 767, 765, 3, 2, 2, 2, 767, 768, 3, 2, 2, 2, 768, 770, 3, 2, 2, 2, 769, 767, 3, 2, 2, 2, 770, 772, 9, 7, 2, 2, 771, 767, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 774, 3, 2, 2, 2, 773, 775, 9, 3, 2, 2, 774, 773, 3, 2, 2, 2, 774, 775, 3, 2, 2, 2, 775, 140, 3, 2, 2, 2, 776, 777, 7, 50, 2, 2, 777, 778, 9, 9, 2, 2, 778, 786, 9, 10, 2, 2, 779, 781, 9, 11, 2, 2, 780, 779, 3, 2, 2, 2, 781, 784, 3, 2, 2, 2, 782, 780, 3, 2, 2, 2, 782, 783, 3, 2, 2, 2, 783, 785, 3, 2, 2, 2, 784, 782, 3, 2, 2, 2, 785, 787, 9, 10, 2, 2, 786, 782, 3, 2, 2, 2, 786, 787, 3, 2, 2, 2, 787, 789, 3, 2, 2, 2, 788, 790, 9, 3, 2, 2, 789, 788, 3, 2, 2, 2, 789, 790, 3, 2, 2, 2, 790, 142, 3, 2, 2, 2, 791, 792, 5, 267, 134, 2, 792, 794, 7, 48, 2, 2, 793, 795, 5, 267, 134, 2, 794, 793, 3, 2, 2, 2, 794, 795, 3, 2, 2, 2, 795, 799, 3, 2, 2, 2, 796, 797, 7, 48, 2, 2, 797, 799, 5, 267, 134, 2, 798, 791, 3, 2, 2, 2, 798, 796, 3, 2, 2, 2, 799, 801, 3, 2, 2, 2, 800, 802, 5, 259, 130, 2, 801, 800, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 804, 3, 2, 2, 2, 803, 805, 9, 12, 2, 2, 804, 803, 3, 2, 2, 2, 804, 805, 3, 2, 2, 2, 805, 815, 3, 2, 2, 2, 806, 812, 5, 267, 134, 2, 807, 809, 5, 259, 130, 2, 808, 810, 9, 12, 2, 2, 809, 808, 3, 2, 2, 2, 809, 810, 3, 2, 2, 2, 810, 813, 3, 2, 2, 2, 811, 813, 9, 12, 2, 2, 812, 807, 3, 2, 2, 2, 812, 811, 3, 2, 2, 2, 813, 815, 3, 2, 2, 2, 814, 798, 3, 2, 2, 2, 814, 806, 3, 2, 2, 2, 815, 144, 3, 2, 2, 2, 816, 817, 7, 50, 2, 2, 817, 827, 9, 4, 2, 2, 818, 820, 5, 263, 132, 2, 819, 821, 7, 48, 2, 2, 820, 819, 3, 2, 2, 2, 820, 821, 3, 2, 2, 2, 821, 828, 3, 2, 2, 2, 822, 824, 5, 263, 132, 2, 823, 822, 3, 2, 2, 2, 823, 824, 3, 2, 2, 2, 824, 825, 3, 2, 2, 2, 825, 826, 7, 48, 2, 2, 826, 828, 5, 263, 132, 2, 827, 818, 3, 2, 2, 2, 827, 823, 3, 2, 2, 2, 828, 829, 3, 2, 2, 2, 829, 831, 9, 13, 2, 2, 830, 832, 9, 14, 2, 2, 831, 830, 3, 2, 2, 2, 831, 832, 3, 2, 2, 2, 832, 833, 3, 2, 2, 2, 833, 835, 5, 267, 134, 2, 834, 836, 9, 12, 2, 2, 835, 834, 3, 2, 2, 2, 835, 836, 3, 2, 2, 2, 836, 146, 3, 2, 2, 2, 837, 838, 7, 118, 2, 2, 838, 839, 7, 116, 2, 2, 839, 840, 7, 119, 2, 2, 840, 847, 7, 103, 2, 2, 841, 842, 7, 104, 2, 2, 842, 843, 7, 99, 2, 2, 843, 844, 7, 110, 2, 2, 844, 845, 7, 117, 2, 2, 845, 847, 7, 103, 2, 2, 846, 837, 3, 2, 2, 2, 846, 841, 3, 2, 2, 2, 847, 148, 3, 2, 2, 2, 848, 851, 7, 41, 2, 2, 849, 852, 10, 15, 2, 2, 850, 852, 5, 261, 131, 2, 851, 849, 3, 2, 2, 2, 851, 850, 3, 2, 2, 2, 852, 853, 3, 2, 2, 2, 853, 854, 7, 41, 2, 2, 854, 150, 3, 2, 2, 2, 855, 860, 7, 36, 2, 2, 856, 859, 10, 16, 2, 2, 857, 859, 5, 261, 131, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 862, 3, 2, 2, 2, 860, 858, 3, 2, 2, 2, 860, 861, 3, 2, 2, 2, 861, 863, 3, 2, 2, 2, 862, 860, 3, 2, 2, 2, 863, 864, 7, 36, 2, 2, 864, 152, 3, 2, 2, 2, 865, 866, 7, 36, 2, 2, 866, 867, 7, 36, 2, 2, 867, 868, 7, 36, 2, 2, 868, 872, 3, 2, 2, 2, 869, 871, 9, 17, 2, 2, 870, 869, 3, 2, 2, 2, 871, 874, 3, 2, 2, 2, 872, 870, 3, 2, 2, 2, 872, 873, 3, 2, 2, 2, 873, 875, 3, 2, 2, 2, 874, 872, 3, 2, 2, 2, 875, 880, 9, 18, 2, 2, 876, 879, 11, 2, 2, 2, 877, 879, 5, 261, 131, 2, 878, 876, 3, 2, 2, 2, 878, 877, 3, 2, 2, 2, 879, 882, 3, 2, 2, 2, 880, 881, 3, 2, 2, 2, 880, 878, 3, 2, 2, 2, 881, 883, 3, 2, 2, 2, 882, 880, 3, 2, 2, 2, 883, 884, 7, 36, 2, 2, 884, 885, 7, 36, 2, 2, 885, 886, 7, 36, 2, 2, 886, 154, 3, 2, 2, 2, 887, 888, 7, 112, 2, 2, 888, 889, 7, 119, 2, 2, 889, 890, 7, 110, 2, 2, 890, 891, 7, 110, 2, 2, 891, 156, 3, 2, 2, 2, 892, 893, 7, 42, 2, 2, 893, 158, 3, 2, 2, 2, 894, 895, 7, 43, 2, 2, 895, 160, 3, 2, 2, 2, 896, 897, 7, 125, 2, 2, 897, 162, 3, 2, 2, 2, 898, 899, 7, 127, 2, 2, 899, 164, 3, 2, 2, 2, 900, 901, 7, 93, 2, 2, 901, 166, 3, 2, 2, 2, 902, 903, 7, 95, 2, 2, 903, 168, 3, 2, 2, 2, 904, 905, 7, 61, 2, 2, 905, 170, 3, 2, 2, 2, 906, 907, 7, 46, 2, 2, 907, 172, 3, 2, 2, 2, 908, 909, 7, 48, 2, 2, 909, 174, 3, 2, 2, 2, 910, 911, 7, 63, 2, 2, 911, 176, 3, 2, 2, 2, 912, 913, 7, 64, 2, 2, 913, 178, 3, 2, 2, 2, 914, 915, 7, 62, 2, 2, 915, 180, 3, 2, 2, 2, 916, 917, 7, 35, 2, 2, 917, 182, 3, 2, 2, 2, 918, 919, 7, 128, 2, 2, 919, 184, 3, 2, 2, 2, 920, 921, 7, 65, 2, 2, 921, 186, 3, 2, 2, 2, 922, 923, 7, 60, 2, 2, 923, 188, 3, 2, 2, 2, 924, 925, 7, 63, 2, 2, 925, 926, 7, 63, 2, 2, 926, 190, 3, 2, 2, 2, 927, 928, 7, 62, 2, 2, 928, 929, 7, 63, 2, 2, 929, 192, 3, 2, 2, 2, 930, 931, 7, 64, 2, 2, 931, 932, 7, 63, 2, 2, 932, 194, 3, 2, 2, 2, 933, 934, 7, 35, 2, 2, 934, 935, 7, 63, 2, 2, 935, 196, 3, 2, 2, 2, 936, 937, 7, 40, 2, 2, 937, 938, 7, 40, 2, 2, 938, 198, 3, 2, 2, 2, 939, 940, 7, 126, 2, 2, 940, 941, 7, 126, 2, 2, 941, 200, 3, 2, 2, 2, 942, 943, 7, 45, 2, 2, 943, 944, 7, 45, 2, 2, 944, 202, 3, 2, 2, 2, 945, 946, 7, 47, 2, 2, 946, 947, 7, 47, 2, 2, 947, 204, 3, 2, 2, 2, 948, 949, 7, 45, 2, 2, 949, 206, 3, 2, 2, 2, 950, 951, 7, 47, 2, 2, 951, 208, 3, 2, 2, 2, 952, 953, 7, 44, 2, 2, 953, 210, 3, 2, 2, 2, 954, 955, 7, 49, 2, 2, 955, 212, 3, 2, 2, 2, 956, 957, 7, 40, 2, 2, 957, 214, 3, 2, 2, 2, 958, 959, 7, 126, 2, 2, 959, 216, 3, 2, 2, 2, 960, 961, 7, 96, 2, 2, 961, 218, 3, 2, 2, 2, 962, 963, 7, 39, 2, 2, 963, 220, 3, 2, 2, 2, 964, 965, 7, 45, 2, 2, 965, 966, 7, 63, 2, 2, 966, 222, 3, 2, 2, 2, 967, 968, 7, 47, 2, 2, 968, 969, 7, 63, 2, 2, 969, 224, 3, 2, 2, 2, 970, 971, 7, 44, 2, 2, 971, 972, 7, 63, 2, 2, 972, 226, 3, 2, 2, 2, 973, 974, 7, 49, 2, 2, 974, 975, 7, 63, 2, 2, 975, 228, 3, 2, 2, 2, 976, 977, 7, 40, 2, 2, 977, 978, 7, 63, 2, 2, 978, 230, 3, 2, 2, 2, 979, 980, 7, 126, 2, 2, 980, 981, 7, 63, 2, 2, 981, 232, 3, 2, 2, 2, 982, 983, 7, 96, 2, 2, 983, 984, 7, 63, 2, 2, 984, 234, 3, 2, 2, 2, 985, 986, 7, 39, 2, 2, 986, 987, 7, 63, 2, 2, 987, 236, 3, 2, 2, 2, 988, 989, 7, 62, 2, 2, 989, 990, 7, 62, 2, 2, 990, 991, 7, 63, 2, 2, 991, 238, 3, 2, 2, 2, 992, 993, 7, 64, 2, 2, 993, 994, 7, 64, 2, 2, 994, 995, 7, 63, 2, 2, 995, 240, 3, 2, 2, 2, 996, 997, 7, 64, 2, 2, 997, 998, 7, 64, 2, 2, 998, 999, 7, 64, 2, 2, 999, 1000, 7, 63, 2, 2, 1000, 242, 3, 2, 2, 2, 1001, 1002, 7, 47, 2, 2, 1002, 1003, 7, 64, 2, 2, 1003, 244, 3, 2, 2, 2, 1004, 1005, 7, 60, 2, 2, 1005, 1006, 7, 60, 2, 2, 1006, 246, 3, 2, 2, 2, 1007, 1008, 7, 66, 2, 2, 1008, 248, 3, 2, 2, 2, 1009, 1010, 7, 48, 2, 2, 1010, 1011, 7, 48, 2, 2, 1011, 1012, 7, 48, 2, 2, 1012, 250, 3, 2, 2, 2, 1013, 1015, 9, 19, 2, 2, 1014, 1013, 3, 2, 2, 2, 1015, 1016, 3, 2, 2, 2, 1016, 1014, 3, 2, 2, 2, 1016, 1017, 3, 2, 2, 2, 1017, 1018, 3, 2, 2, 2, 1018, 1019, 8, 126, 2, 2, 1019, 252, 3, 2, 2, 2, 1020, 1021, 7, 49, 2, 2, 1021, 1022, 7, 44, 2, 2, 1022, 1026, 3, 2, 2, 2, 1023, 1025, 11, 2, 2, 2, 1024, 1023, 3, 2, 2, 2, 1025, 1028, 3, 2, 2, 2, 1026, 1027, 3, 2, 2, 2, 1026, 1024, 3, 2, 2, 2, 1027, 1029, 3, 2, 2, 2, 1028, 1026, 3, 2, 2, 2, 1029, 1030, 7, 44, 2, 2, 1030, 1031, 7, 49, 2, 2, 1031, 1032, 3, 2, 2, 2, 1032, 1033, 8, 127, 2, 2, 1033, 254, 3, 2, 2, 2, 1034, 1035, 7, 49, 2, 2, 1035, 1036, 7, 49, 2, 2, 1036, 1040, 3, 2, 2, 2, 1037, 1039, 10, 18, 2, 2, 1038, 1037, 3, 2, 2, 2, 1039, 1042, 3, 2, 2, 2, 1040, 1038, 3, 2, 2, 2, 1040, 1041, 3, 2, 2, 2, 1041, 1043, 3, 2, 2, 2, 1042, 1040, 3, 2, 2, 2, 1043, 1044, 8, 128, 2, 2, 1044, 256, 3, 2, 2, 2, 1045, 1049, 5, 271, 136, 2, 1046, 1048, 5, 269, 135, 2, 1047, 1046, 3, 2, 2, 2, 1048, 1051, 3, 2, 2, 2, 1049, 1047, 3, 2, 2, 2, 1049, 1050, 3, 2, 2, 2, 1050, 258, 3, 2, 2, 2, 1051, 1049, 3, 2, 2, 2, 1052, 1054, 9, 20, 2, 2, 1053, 1055, 9, 14, 2, 2, 1054, 1053, 3, 2, 2, 2, 1054, 1055, 3, 2, 2, 2, 1055, 1056, 3, 2, 2, 2, 1056, 1057, 5, 267, 134, 2, 1057, 260, 3, 2, 2, 2, 1058, 1059, 7, 94, 2, 2, 1059, 1080, 9, 21, 2, 2, 1060, 1065, 7, 94, 2, 2, 1061, 1063, 9, 22, 2, 2, 1062, 1061, 3, 2, 2, 2, 1062, 1063, 3, 2, 2, 2, 1063, 1064, 3, 2, 2, 2, 1064, 1066, 9, 7, 2, 2, 1065, 1062, 3, 2, 2, 2, 1065, 1066, 3, 2, 2, 2, 1066, 1067, 3, 2, 2, 2, 1067, 1080, 9, 7, 2, 2, 1068, 1070, 7, 94, 2, 2, 1069, 1071, 7, 119, 2, 2, 1070, 1069, 3, 2, 2, 2, 1071, 1072, 3, 2, 2, 2, 1072, 1070, 3, 2, 2, 2, 1072, 1073, 3, 2, 2, 2, 1073, 1074, 3, 2, 2, 2, 1074, 1075, 5, 265, 133, 2, 1075, 1076, 5, 265, 133, 2, 1076, 1077, 5, 265, 133, 2, 1077, 1078, 5, 265, 133, 2, 1078, 1080, 3, 2, 2, 2, 1079, 1058, 3, 2, 2, 2, 1079, 1060, 3, 2, 2, 2, 1079, 1068, 3, 2, 2, 2, 1080, 262, 3, 2, 2, 2, 1081, 1090, 5, 265, 133, 2, 1082, 1085, 5, 265, 133, 2, 1083, 1085, 7, 97, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1083, 3, 2, 2, 2, 1085, 1088, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1086, 1087, 3, 2, 2, 2, 1087, 1089, 3, 2, 2, 2, 1088, 1086, 3, 2, 2, 2, 1089, 1091, 5, 265, 133, 2, 1090, 1086, 3, 2, 2, 2, 1090, 1091, 3, 2, 2, 2, 1091, 264, 3, 2, 2, 2, 1092, 1093, 9, 5, 2, 2, 1093, 266, 3, 2, 2, 2, 1094, 1102, 9, 23, 2, 2, 1095, 1097, 9, 24, 2, 2, 1096, 1095, 3, 2, 2, 2, 1097, 1100, 3, 2, 2, 2, 1098, 1096, 3, 2, 2, 2, 1098, 1099, 3, 2, 2, 2, 1099, 1101, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1101, 1103, 9, 23, 2, 2, 1102, 1098, 3, 2, 2, 2, 1102, 1103, 3, 2, 2, 2, 1103, 268, 3, 2, 2, 2, 1104, 1107, 5, 271, 136, 2, 1105, 1107, 9, 23, 2, 2, 1106, 1104, 3, 2, 2, 2, 1106, 1105, 3, 2, 2, 2, 1107, 270, 3, 2, 2, 2, 1108, 1113, 9, 25, 2, 2, 1109, 1113, 10, 26, 2, 2, 1110, 1111, 9, 27, 2, 2, 1111, 1113, 9, 28, 2, 2, 1112, 1108, 3, 2, 2, 2, 1112, 1109, 3, 2, 2, 2, 1112, 1110, 3, 2, 2, 2, 1113, 272, 3, 2, 2, 2, 53, 2, 726, 731, 734, 736, 739, 747, 751, 754, 760, 767, 771, 774, 782, 786, 789, 794, 798, 801, 804, 809, 812, 814, 820, 823, 827, 831, 835, 846, 851, 858, 860, 872, 878, 880, 1016, 1026, 1040, 1049, 1054, 1062, 1065, 1072, 1079, 1084, 1086, 1090, 1098, 1102, 1106, 1112, 3, 2, 3, 2] \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java deleted file mode 100644 index 1b4d6730..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.java +++ /dev/null @@ -1,581 +0,0 @@ -// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaLexer.g4 by ANTLR 4.9.2 -package org.javabip.verification.parser; -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class JavaLexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - ABSTRACT=1, ASSERT=2, BOOLEAN=3, BREAK=4, BYTE=5, CASE=6, CATCH=7, CHAR=8, - CLASS=9, CONST=10, CONTINUE=11, DEFAULT=12, DO=13, DOUBLE=14, ELSE=15, - ENUM=16, EXTENDS=17, FINAL=18, FINALLY=19, FLOAT=20, FOR=21, IF=22, GOTO=23, - IMPLEMENTS=24, IMPORT=25, INSTANCEOF=26, INT=27, INTERFACE=28, LONG=29, - NATIVE=30, NEW=31, PACKAGE=32, PRIVATE=33, PROTECTED=34, PUBLIC=35, RETURN=36, - SHORT=37, STATIC=38, STRICTFP=39, SUPER=40, SWITCH=41, SYNCHRONIZED=42, - THIS=43, THROW=44, THROWS=45, TRANSIENT=46, TRY=47, VOID=48, VOLATILE=49, - WHILE=50, MODULE=51, OPEN=52, REQUIRES=53, EXPORTS=54, OPENS=55, TO=56, - USES=57, PROVIDES=58, WITH=59, TRANSITIVE=60, VAR=61, YIELD=62, RECORD=63, - SEALED=64, PERMITS=65, NON_SEALED=66, DECIMAL_LITERAL=67, HEX_LITERAL=68, - OCT_LITERAL=69, BINARY_LITERAL=70, FLOAT_LITERAL=71, HEX_FLOAT_LITERAL=72, - BOOL_LITERAL=73, CHAR_LITERAL=74, STRING_LITERAL=75, TEXT_BLOCK=76, NULL_LITERAL=77, - LPAREN=78, RPAREN=79, LBRACE=80, RBRACE=81, LBRACK=82, RBRACK=83, SEMI=84, - COMMA=85, DOT=86, ASSIGN=87, GT=88, LT=89, BANG=90, TILDE=91, QUESTION=92, - COLON=93, EQUAL=94, LE=95, GE=96, NOTEQUAL=97, AND=98, OR=99, INC=100, - DEC=101, ADD=102, SUB=103, MUL=104, DIV=105, BITAND=106, BITOR=107, CARET=108, - MOD=109, ADD_ASSIGN=110, SUB_ASSIGN=111, MUL_ASSIGN=112, DIV_ASSIGN=113, - AND_ASSIGN=114, OR_ASSIGN=115, XOR_ASSIGN=116, MOD_ASSIGN=117, LSHIFT_ASSIGN=118, - RSHIFT_ASSIGN=119, URSHIFT_ASSIGN=120, ARROW=121, COLONCOLON=122, AT=123, - ELLIPSIS=124, WS=125, COMMENT=126, LINE_COMMENT=127, IDENTIFIER=128; - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - private static String[] makeRuleNames() { - return new String[] { - "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", "CHAR", - "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", "ENUM", - "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", "IMPLEMENTS", - "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", - "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", - "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", - "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", "OPEN", "REQUIRES", - "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", "TRANSITIVE", "VAR", - "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", "DECIMAL_LITERAL", - "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", "HEX_FLOAT_LITERAL", - "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", "TEXT_BLOCK", "NULL_LITERAL", - "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK", "SEMI", "COMMA", - "DOT", "ASSIGN", "GT", "LT", "BANG", "TILDE", "QUESTION", "COLON", "EQUAL", - "LE", "GE", "NOTEQUAL", "AND", "OR", "INC", "DEC", "ADD", "SUB", "MUL", - "DIV", "BITAND", "BITOR", "CARET", "MOD", "ADD_ASSIGN", "SUB_ASSIGN", - "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", "OR_ASSIGN", "XOR_ASSIGN", - "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", "URSHIFT_ASSIGN", "ARROW", - "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", "LINE_COMMENT", "IDENTIFIER", - "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits", - "LetterOrDigit", "Letter" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'abstract'", "'assert'", "'boolean'", "'break'", "'byte'", "'case'", - "'catch'", "'char'", "'class'", "'const'", "'continue'", "'default'", - "'do'", "'double'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", - "'float'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", - "'int'", "'interface'", "'long'", "'native'", "'new'", "'package'", "'private'", - "'protected'", "'public'", "'return'", "'short'", "'static'", "'strictfp'", - "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", - "'transient'", "'try'", "'void'", "'volatile'", "'while'", "'module'", - "'open'", "'requires'", "'exports'", "'opens'", "'to'", "'uses'", "'provides'", - "'with'", "'transitive'", "'var'", "'yield'", "'record'", "'sealed'", - "'permits'", "'non-sealed'", null, null, null, null, null, null, null, - null, null, null, "'null'", "'('", "')'", "'{'", "'}'", "'['", "']'", - "';'", "','", "'.'", "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", - "'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", - "'-'", "'*'", "'/'", "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", - "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'->'", - "'::'", "'@'", "'...'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", - "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", - "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "IF", "GOTO", - "IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", - "NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", - "STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", - "THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "MODULE", - "OPEN", "REQUIRES", "EXPORTS", "OPENS", "TO", "USES", "PROVIDES", "WITH", - "TRANSITIVE", "VAR", "YIELD", "RECORD", "SEALED", "PERMITS", "NON_SEALED", - "DECIMAL_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BINARY_LITERAL", "FLOAT_LITERAL", - "HEX_FLOAT_LITERAL", "BOOL_LITERAL", "CHAR_LITERAL", "STRING_LITERAL", - "TEXT_BLOCK", "NULL_LITERAL", "LPAREN", "RPAREN", "LBRACE", "RBRACE", - "LBRACK", "RBRACK", "SEMI", "COMMA", "DOT", "ASSIGN", "GT", "LT", "BANG", - "TILDE", "QUESTION", "COLON", "EQUAL", "LE", "GE", "NOTEQUAL", "AND", - "OR", "INC", "DEC", "ADD", "SUB", "MUL", "DIV", "BITAND", "BITOR", "CARET", - "MOD", "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "AND_ASSIGN", - "OR_ASSIGN", "XOR_ASSIGN", "MOD_ASSIGN", "LSHIFT_ASSIGN", "RSHIFT_ASSIGN", - "URSHIFT_ASSIGN", "ARROW", "COLONCOLON", "AT", "ELLIPSIS", "WS", "COMMENT", - "LINE_COMMENT", "IDENTIFIER" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - - public JavaLexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "JavaLexer.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getChannelNames() { return channelNames; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u0082\u045a\b\1\4"+ - "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ - "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ - "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ - "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ - " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ - "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ - "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t"+ - "=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4"+ - "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\t"+ - "T\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_"+ - "\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k"+ - "\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv"+ - "\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t"+ - "\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084"+ - "\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\3\2\3"+ - "\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4"+ - "\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3"+ - "\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ - "\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17"+ - "\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21"+ - "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23"+ - "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25"+ - "\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31"+ - "\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32"+ - "\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34"+ - "\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36"+ - "\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3"+ - "!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#"+ - "\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&"+ - "\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3)\3)\3"+ - ")\3)\3)\3)\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3"+ - "+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3"+ - "/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62"+ - "\3\62\3\62\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\64"+ - "\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\66"+ - "\3\66\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67"+ - "\38\38\38\38\38\38\39\39\39\3:\3:\3:\3:\3:\3;\3;\3;\3;\3;\3;\3;\3;\3;"+ - "\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?"+ - "\3?\3?\3?\3@\3@\3@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B"+ - "\3B\3B\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\5D\u02d7\nD\3D\6D\u02da"+ - "\nD\rD\16D\u02db\3D\5D\u02df\nD\5D\u02e1\nD\3D\5D\u02e4\nD\3E\3E\3E\3"+ - "E\7E\u02ea\nE\fE\16E\u02ed\13E\3E\5E\u02f0\nE\3E\5E\u02f3\nE\3F\3F\7F"+ - "\u02f7\nF\fF\16F\u02fa\13F\3F\3F\7F\u02fe\nF\fF\16F\u0301\13F\3F\5F\u0304"+ - "\nF\3F\5F\u0307\nF\3G\3G\3G\3G\7G\u030d\nG\fG\16G\u0310\13G\3G\5G\u0313"+ - "\nG\3G\5G\u0316\nG\3H\3H\3H\5H\u031b\nH\3H\3H\5H\u031f\nH\3H\5H\u0322"+ - "\nH\3H\5H\u0325\nH\3H\3H\3H\5H\u032a\nH\3H\5H\u032d\nH\5H\u032f\nH\3I"+ - "\3I\3I\3I\5I\u0335\nI\3I\5I\u0338\nI\3I\3I\5I\u033c\nI\3I\3I\5I\u0340"+ - "\nI\3I\3I\5I\u0344\nI\3J\3J\3J\3J\3J\3J\3J\3J\3J\5J\u034f\nJ\3K\3K\3K"+ - "\5K\u0354\nK\3K\3K\3L\3L\3L\7L\u035b\nL\fL\16L\u035e\13L\3L\3L\3M\3M\3"+ - "M\3M\3M\7M\u0367\nM\fM\16M\u036a\13M\3M\3M\3M\7M\u036f\nM\fM\16M\u0372"+ - "\13M\3M\3M\3M\3M\3N\3N\3N\3N\3N\3O\3O\3P\3P\3Q\3Q\3R\3R\3S\3S\3T\3T\3"+ - "U\3U\3V\3V\3W\3W\3X\3X\3Y\3Y\3Z\3Z\3[\3[\3\\\3\\\3]\3]\3^\3^\3_\3_\3_"+ - "\3`\3`\3`\3a\3a\3a\3b\3b\3b\3c\3c\3c\3d\3d\3d\3e\3e\3e\3f\3f\3f\3g\3g"+ - "\3h\3h\3i\3i\3j\3j\3k\3k\3l\3l\3m\3m\3n\3n\3o\3o\3o\3p\3p\3p\3q\3q\3q"+ - "\3r\3r\3r\3s\3s\3s\3t\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3w\3x\3x\3x\3x"+ - "\3y\3y\3y\3y\3y\3z\3z\3z\3{\3{\3{\3|\3|\3}\3}\3}\3}\3~\6~\u03f7\n~\r~"+ - "\16~\u03f8\3~\3~\3\177\3\177\3\177\3\177\7\177\u0401\n\177\f\177\16\177"+ - "\u0404\13\177\3\177\3\177\3\177\3\177\3\177\3\u0080\3\u0080\3\u0080\3"+ - "\u0080\7\u0080\u040f\n\u0080\f\u0080\16\u0080\u0412\13\u0080\3\u0080\3"+ - "\u0080\3\u0081\3\u0081\7\u0081\u0418\n\u0081\f\u0081\16\u0081\u041b\13"+ - "\u0081\3\u0082\3\u0082\5\u0082\u041f\n\u0082\3\u0082\3\u0082\3\u0083\3"+ - "\u0083\3\u0083\3\u0083\5\u0083\u0427\n\u0083\3\u0083\5\u0083\u042a\n\u0083"+ - "\3\u0083\3\u0083\3\u0083\6\u0083\u042f\n\u0083\r\u0083\16\u0083\u0430"+ - "\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\5\u0083\u0438\n\u0083\3\u0084"+ - "\3\u0084\3\u0084\7\u0084\u043d\n\u0084\f\u0084\16\u0084\u0440\13\u0084"+ - "\3\u0084\5\u0084\u0443\n\u0084\3\u0085\3\u0085\3\u0086\3\u0086\7\u0086"+ - "\u0449\n\u0086\f\u0086\16\u0086\u044c\13\u0086\3\u0086\5\u0086\u044f\n"+ - "\u0086\3\u0087\3\u0087\5\u0087\u0453\n\u0087\3\u0088\3\u0088\3\u0088\3"+ - "\u0088\5\u0088\u0459\n\u0088\4\u0370\u0402\2\u0089\3\3\5\4\7\5\t\6\13"+ - "\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'"+ - "\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'"+ - "M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u{?}@\177"+ - "A\u0081B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091J\u0093"+ - "K\u0095L\u0097M\u0099N\u009bO\u009dP\u009fQ\u00a1R\u00a3S\u00a5T\u00a7"+ - "U\u00a9V\u00abW\u00adX\u00afY\u00b1Z\u00b3[\u00b5\\\u00b7]\u00b9^\u00bb"+ - "_\u00bd`\u00bfa\u00c1b\u00c3c\u00c5d\u00c7e\u00c9f\u00cbg\u00cdh\u00cf"+ - "i\u00d1j\u00d3k\u00d5l\u00d7m\u00d9n\u00dbo\u00ddp\u00dfq\u00e1r\u00e3"+ - "s\u00e5t\u00e7u\u00e9v\u00ebw\u00edx\u00efy\u00f1z\u00f3{\u00f5|\u00f7"+ - "}\u00f9~\u00fb\177\u00fd\u0080\u00ff\u0081\u0101\u0082\u0103\2\u0105\2"+ - "\u0107\2\u0109\2\u010b\2\u010d\2\u010f\2\3\2\35\3\2\63;\4\2NNnn\4\2ZZ"+ - "zz\5\2\62;CHch\6\2\62;CHaach\3\2\629\4\2\629aa\4\2DDdd\3\2\62\63\4\2\62"+ - "\63aa\6\2FFHHffhh\4\2RRrr\4\2--//\6\2\f\f\17\17))^^\6\2\f\f\17\17$$^^"+ - "\4\2\13\13\"\"\4\2\f\f\17\17\5\2\13\f\16\17\"\"\4\2GGgg\n\2$$))^^ddhh"+ - "ppttvv\3\2\62\65\3\2\62;\4\2\62;aa\6\2&&C\\aac|\4\2\2\u0081\ud802\udc01"+ - "\3\2\ud802\udc01\3\2\udc02\ue001\2\u0486\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3"+ - "\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2"+ - "\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35"+ - "\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)"+ - "\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2"+ - "\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2"+ - "A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3"+ - "\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2"+ - "\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2"+ - "g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3"+ - "\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3"+ - "\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2"+ - "\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2\2\2\u008f\3\2\2\2\2\u0091"+ - "\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099\3\2\2"+ - "\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3"+ - "\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab\3\2\2"+ - "\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3\3\2\2\2\2\u00b5"+ - "\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2\2\2\u00bd\3\2\2"+ - "\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2\2\2\u00c7"+ - "\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2"+ - "\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9"+ - "\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2"+ - "\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb"+ - "\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2"+ - "\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd"+ - "\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\3\u0111\3\2\2\2\5\u011a\3\2\2"+ - "\2\7\u0121\3\2\2\2\t\u0129\3\2\2\2\13\u012f\3\2\2\2\r\u0134\3\2\2\2\17"+ - "\u0139\3\2\2\2\21\u013f\3\2\2\2\23\u0144\3\2\2\2\25\u014a\3\2\2\2\27\u0150"+ - "\3\2\2\2\31\u0159\3\2\2\2\33\u0161\3\2\2\2\35\u0164\3\2\2\2\37\u016b\3"+ - "\2\2\2!\u0170\3\2\2\2#\u0175\3\2\2\2%\u017d\3\2\2\2\'\u0183\3\2\2\2)\u018b"+ - "\3\2\2\2+\u0191\3\2\2\2-\u0195\3\2\2\2/\u0198\3\2\2\2\61\u019d\3\2\2\2"+ - "\63\u01a8\3\2\2\2\65\u01af\3\2\2\2\67\u01ba\3\2\2\29\u01be\3\2\2\2;\u01c8"+ - "\3\2\2\2=\u01cd\3\2\2\2?\u01d4\3\2\2\2A\u01d8\3\2\2\2C\u01e0\3\2\2\2E"+ - "\u01e8\3\2\2\2G\u01f2\3\2\2\2I\u01f9\3\2\2\2K\u0200\3\2\2\2M\u0206\3\2"+ - "\2\2O\u020d\3\2\2\2Q\u0216\3\2\2\2S\u021c\3\2\2\2U\u0223\3\2\2\2W\u0230"+ - "\3\2\2\2Y\u0235\3\2\2\2[\u023b\3\2\2\2]\u0242\3\2\2\2_\u024c\3\2\2\2a"+ - "\u0250\3\2\2\2c\u0255\3\2\2\2e\u025e\3\2\2\2g\u0264\3\2\2\2i\u026b\3\2"+ - "\2\2k\u0270\3\2\2\2m\u0279\3\2\2\2o\u0281\3\2\2\2q\u0287\3\2\2\2s\u028a"+ - "\3\2\2\2u\u028f\3\2\2\2w\u0298\3\2\2\2y\u029d\3\2\2\2{\u02a8\3\2\2\2}"+ - "\u02ac\3\2\2\2\177\u02b2\3\2\2\2\u0081\u02b9\3\2\2\2\u0083\u02c0\3\2\2"+ - "\2\u0085\u02c8\3\2\2\2\u0087\u02e0\3\2\2\2\u0089\u02e5\3\2\2\2\u008b\u02f4"+ - "\3\2\2\2\u008d\u0308\3\2\2\2\u008f\u032e\3\2\2\2\u0091\u0330\3\2\2\2\u0093"+ - "\u034e\3\2\2\2\u0095\u0350\3\2\2\2\u0097\u0357\3\2\2\2\u0099\u0361\3\2"+ - "\2\2\u009b\u0377\3\2\2\2\u009d\u037c\3\2\2\2\u009f\u037e\3\2\2\2\u00a1"+ - "\u0380\3\2\2\2\u00a3\u0382\3\2\2\2\u00a5\u0384\3\2\2\2\u00a7\u0386\3\2"+ - "\2\2\u00a9\u0388\3\2\2\2\u00ab\u038a\3\2\2\2\u00ad\u038c\3\2\2\2\u00af"+ - "\u038e\3\2\2\2\u00b1\u0390\3\2\2\2\u00b3\u0392\3\2\2\2\u00b5\u0394\3\2"+ - "\2\2\u00b7\u0396\3\2\2\2\u00b9\u0398\3\2\2\2\u00bb\u039a\3\2\2\2\u00bd"+ - "\u039c\3\2\2\2\u00bf\u039f\3\2\2\2\u00c1\u03a2\3\2\2\2\u00c3\u03a5\3\2"+ - "\2\2\u00c5\u03a8\3\2\2\2\u00c7\u03ab\3\2\2\2\u00c9\u03ae\3\2\2\2\u00cb"+ - "\u03b1\3\2\2\2\u00cd\u03b4\3\2\2\2\u00cf\u03b6\3\2\2\2\u00d1\u03b8\3\2"+ - "\2\2\u00d3\u03ba\3\2\2\2\u00d5\u03bc\3\2\2\2\u00d7\u03be\3\2\2\2\u00d9"+ - "\u03c0\3\2\2\2\u00db\u03c2\3\2\2\2\u00dd\u03c4\3\2\2\2\u00df\u03c7\3\2"+ - "\2\2\u00e1\u03ca\3\2\2\2\u00e3\u03cd\3\2\2\2\u00e5\u03d0\3\2\2\2\u00e7"+ - "\u03d3\3\2\2\2\u00e9\u03d6\3\2\2\2\u00eb\u03d9\3\2\2\2\u00ed\u03dc\3\2"+ - "\2\2\u00ef\u03e0\3\2\2\2\u00f1\u03e4\3\2\2\2\u00f3\u03e9\3\2\2\2\u00f5"+ - "\u03ec\3\2\2\2\u00f7\u03ef\3\2\2\2\u00f9\u03f1\3\2\2\2\u00fb\u03f6\3\2"+ - "\2\2\u00fd\u03fc\3\2\2\2\u00ff\u040a\3\2\2\2\u0101\u0415\3\2\2\2\u0103"+ - "\u041c\3\2\2\2\u0105\u0437\3\2\2\2\u0107\u0439\3\2\2\2\u0109\u0444\3\2"+ - "\2\2\u010b\u0446\3\2\2\2\u010d\u0452\3\2\2\2\u010f\u0458\3\2\2\2\u0111"+ - "\u0112\7c\2\2\u0112\u0113\7d\2\2\u0113\u0114\7u\2\2\u0114\u0115\7v\2\2"+ - "\u0115\u0116\7t\2\2\u0116\u0117\7c\2\2\u0117\u0118\7e\2\2\u0118\u0119"+ - "\7v\2\2\u0119\4\3\2\2\2\u011a\u011b\7c\2\2\u011b\u011c\7u\2\2\u011c\u011d"+ - "\7u\2\2\u011d\u011e\7g\2\2\u011e\u011f\7t\2\2\u011f\u0120\7v\2\2\u0120"+ - "\6\3\2\2\2\u0121\u0122\7d\2\2\u0122\u0123\7q\2\2\u0123\u0124\7q\2\2\u0124"+ - "\u0125\7n\2\2\u0125\u0126\7g\2\2\u0126\u0127\7c\2\2\u0127\u0128\7p\2\2"+ - "\u0128\b\3\2\2\2\u0129\u012a\7d\2\2\u012a\u012b\7t\2\2\u012b\u012c\7g"+ - "\2\2\u012c\u012d\7c\2\2\u012d\u012e\7m\2\2\u012e\n\3\2\2\2\u012f\u0130"+ - "\7d\2\2\u0130\u0131\7{\2\2\u0131\u0132\7v\2\2\u0132\u0133\7g\2\2\u0133"+ - "\f\3\2\2\2\u0134\u0135\7e\2\2\u0135\u0136\7c\2\2\u0136\u0137\7u\2\2\u0137"+ - "\u0138\7g\2\2\u0138\16\3\2\2\2\u0139\u013a\7e\2\2\u013a\u013b\7c\2\2\u013b"+ - "\u013c\7v\2\2\u013c\u013d\7e\2\2\u013d\u013e\7j\2\2\u013e\20\3\2\2\2\u013f"+ - "\u0140\7e\2\2\u0140\u0141\7j\2\2\u0141\u0142\7c\2\2\u0142\u0143\7t\2\2"+ - "\u0143\22\3\2\2\2\u0144\u0145\7e\2\2\u0145\u0146\7n\2\2\u0146\u0147\7"+ - "c\2\2\u0147\u0148\7u\2\2\u0148\u0149\7u\2\2\u0149\24\3\2\2\2\u014a\u014b"+ - "\7e\2\2\u014b\u014c\7q\2\2\u014c\u014d\7p\2\2\u014d\u014e\7u\2\2\u014e"+ - "\u014f\7v\2\2\u014f\26\3\2\2\2\u0150\u0151\7e\2\2\u0151\u0152\7q\2\2\u0152"+ - "\u0153\7p\2\2\u0153\u0154\7v\2\2\u0154\u0155\7k\2\2\u0155\u0156\7p\2\2"+ - "\u0156\u0157\7w\2\2\u0157\u0158\7g\2\2\u0158\30\3\2\2\2\u0159\u015a\7"+ - "f\2\2\u015a\u015b\7g\2\2\u015b\u015c\7h\2\2\u015c\u015d\7c\2\2\u015d\u015e"+ - "\7w\2\2\u015e\u015f\7n\2\2\u015f\u0160\7v\2\2\u0160\32\3\2\2\2\u0161\u0162"+ - "\7f\2\2\u0162\u0163\7q\2\2\u0163\34\3\2\2\2\u0164\u0165\7f\2\2\u0165\u0166"+ - "\7q\2\2\u0166\u0167\7w\2\2\u0167\u0168\7d\2\2\u0168\u0169\7n\2\2\u0169"+ - "\u016a\7g\2\2\u016a\36\3\2\2\2\u016b\u016c\7g\2\2\u016c\u016d\7n\2\2\u016d"+ - "\u016e\7u\2\2\u016e\u016f\7g\2\2\u016f \3\2\2\2\u0170\u0171\7g\2\2\u0171"+ - "\u0172\7p\2\2\u0172\u0173\7w\2\2\u0173\u0174\7o\2\2\u0174\"\3\2\2\2\u0175"+ - "\u0176\7g\2\2\u0176\u0177\7z\2\2\u0177\u0178\7v\2\2\u0178\u0179\7g\2\2"+ - "\u0179\u017a\7p\2\2\u017a\u017b\7f\2\2\u017b\u017c\7u\2\2\u017c$\3\2\2"+ - "\2\u017d\u017e\7h\2\2\u017e\u017f\7k\2\2\u017f\u0180\7p\2\2\u0180\u0181"+ - "\7c\2\2\u0181\u0182\7n\2\2\u0182&\3\2\2\2\u0183\u0184\7h\2\2\u0184\u0185"+ - "\7k\2\2\u0185\u0186\7p\2\2\u0186\u0187\7c\2\2\u0187\u0188\7n\2\2\u0188"+ - "\u0189\7n\2\2\u0189\u018a\7{\2\2\u018a(\3\2\2\2\u018b\u018c\7h\2\2\u018c"+ - "\u018d\7n\2\2\u018d\u018e\7q\2\2\u018e\u018f\7c\2\2\u018f\u0190\7v\2\2"+ - "\u0190*\3\2\2\2\u0191\u0192\7h\2\2\u0192\u0193\7q\2\2\u0193\u0194\7t\2"+ - "\2\u0194,\3\2\2\2\u0195\u0196\7k\2\2\u0196\u0197\7h\2\2\u0197.\3\2\2\2"+ - "\u0198\u0199\7i\2\2\u0199\u019a\7q\2\2\u019a\u019b\7v\2\2\u019b\u019c"+ - "\7q\2\2\u019c\60\3\2\2\2\u019d\u019e\7k\2\2\u019e\u019f\7o\2\2\u019f\u01a0"+ - "\7r\2\2\u01a0\u01a1\7n\2\2\u01a1\u01a2\7g\2\2\u01a2\u01a3\7o\2\2\u01a3"+ - "\u01a4\7g\2\2\u01a4\u01a5\7p\2\2\u01a5\u01a6\7v\2\2\u01a6\u01a7\7u\2\2"+ - "\u01a7\62\3\2\2\2\u01a8\u01a9\7k\2\2\u01a9\u01aa\7o\2\2\u01aa\u01ab\7"+ - "r\2\2\u01ab\u01ac\7q\2\2\u01ac\u01ad\7t\2\2\u01ad\u01ae\7v\2\2\u01ae\64"+ - "\3\2\2\2\u01af\u01b0\7k\2\2\u01b0\u01b1\7p\2\2\u01b1\u01b2\7u\2\2\u01b2"+ - "\u01b3\7v\2\2\u01b3\u01b4\7c\2\2\u01b4\u01b5\7p\2\2\u01b5\u01b6\7e\2\2"+ - "\u01b6\u01b7\7g\2\2\u01b7\u01b8\7q\2\2\u01b8\u01b9\7h\2\2\u01b9\66\3\2"+ - "\2\2\u01ba\u01bb\7k\2\2\u01bb\u01bc\7p\2\2\u01bc\u01bd\7v\2\2\u01bd8\3"+ - "\2\2\2\u01be\u01bf\7k\2\2\u01bf\u01c0\7p\2\2\u01c0\u01c1\7v\2\2\u01c1"+ - "\u01c2\7g\2\2\u01c2\u01c3\7t\2\2\u01c3\u01c4\7h\2\2\u01c4\u01c5\7c\2\2"+ - "\u01c5\u01c6\7e\2\2\u01c6\u01c7\7g\2\2\u01c7:\3\2\2\2\u01c8\u01c9\7n\2"+ - "\2\u01c9\u01ca\7q\2\2\u01ca\u01cb\7p\2\2\u01cb\u01cc\7i\2\2\u01cc<\3\2"+ - "\2\2\u01cd\u01ce\7p\2\2\u01ce\u01cf\7c\2\2\u01cf\u01d0\7v\2\2\u01d0\u01d1"+ - "\7k\2\2\u01d1\u01d2\7x\2\2\u01d2\u01d3\7g\2\2\u01d3>\3\2\2\2\u01d4\u01d5"+ - "\7p\2\2\u01d5\u01d6\7g\2\2\u01d6\u01d7\7y\2\2\u01d7@\3\2\2\2\u01d8\u01d9"+ - "\7r\2\2\u01d9\u01da\7c\2\2\u01da\u01db\7e\2\2\u01db\u01dc\7m\2\2\u01dc"+ - "\u01dd\7c\2\2\u01dd\u01de\7i\2\2\u01de\u01df\7g\2\2\u01dfB\3\2\2\2\u01e0"+ - "\u01e1\7r\2\2\u01e1\u01e2\7t\2\2\u01e2\u01e3\7k\2\2\u01e3\u01e4\7x\2\2"+ - "\u01e4\u01e5\7c\2\2\u01e5\u01e6\7v\2\2\u01e6\u01e7\7g\2\2\u01e7D\3\2\2"+ - "\2\u01e8\u01e9\7r\2\2\u01e9\u01ea\7t\2\2\u01ea\u01eb\7q\2\2\u01eb\u01ec"+ - "\7v\2\2\u01ec\u01ed\7g\2\2\u01ed\u01ee\7e\2\2\u01ee\u01ef\7v\2\2\u01ef"+ - "\u01f0\7g\2\2\u01f0\u01f1\7f\2\2\u01f1F\3\2\2\2\u01f2\u01f3\7r\2\2\u01f3"+ - "\u01f4\7w\2\2\u01f4\u01f5\7d\2\2\u01f5\u01f6\7n\2\2\u01f6\u01f7\7k\2\2"+ - "\u01f7\u01f8\7e\2\2\u01f8H\3\2\2\2\u01f9\u01fa\7t\2\2\u01fa\u01fb\7g\2"+ - "\2\u01fb\u01fc\7v\2\2\u01fc\u01fd\7w\2\2\u01fd\u01fe\7t\2\2\u01fe\u01ff"+ - "\7p\2\2\u01ffJ\3\2\2\2\u0200\u0201\7u\2\2\u0201\u0202\7j\2\2\u0202\u0203"+ - "\7q\2\2\u0203\u0204\7t\2\2\u0204\u0205\7v\2\2\u0205L\3\2\2\2\u0206\u0207"+ - "\7u\2\2\u0207\u0208\7v\2\2\u0208\u0209\7c\2\2\u0209\u020a\7v\2\2\u020a"+ - "\u020b\7k\2\2\u020b\u020c\7e\2\2\u020cN\3\2\2\2\u020d\u020e\7u\2\2\u020e"+ - "\u020f\7v\2\2\u020f\u0210\7t\2\2\u0210\u0211\7k\2\2\u0211\u0212\7e\2\2"+ - "\u0212\u0213\7v\2\2\u0213\u0214\7h\2\2\u0214\u0215\7r\2\2\u0215P\3\2\2"+ - "\2\u0216\u0217\7u\2\2\u0217\u0218\7w\2\2\u0218\u0219\7r\2\2\u0219\u021a"+ - "\7g\2\2\u021a\u021b\7t\2\2\u021bR\3\2\2\2\u021c\u021d\7u\2\2\u021d\u021e"+ - "\7y\2\2\u021e\u021f\7k\2\2\u021f\u0220\7v\2\2\u0220\u0221\7e\2\2\u0221"+ - "\u0222\7j\2\2\u0222T\3\2\2\2\u0223\u0224\7u\2\2\u0224\u0225\7{\2\2\u0225"+ - "\u0226\7p\2\2\u0226\u0227\7e\2\2\u0227\u0228\7j\2\2\u0228\u0229\7t\2\2"+ - "\u0229\u022a\7q\2\2\u022a\u022b\7p\2\2\u022b\u022c\7k\2\2\u022c\u022d"+ - "\7|\2\2\u022d\u022e\7g\2\2\u022e\u022f\7f\2\2\u022fV\3\2\2\2\u0230\u0231"+ - "\7v\2\2\u0231\u0232\7j\2\2\u0232\u0233\7k\2\2\u0233\u0234\7u\2\2\u0234"+ - "X\3\2\2\2\u0235\u0236\7v\2\2\u0236\u0237\7j\2\2\u0237\u0238\7t\2\2\u0238"+ - "\u0239\7q\2\2\u0239\u023a\7y\2\2\u023aZ\3\2\2\2\u023b\u023c\7v\2\2\u023c"+ - "\u023d\7j\2\2\u023d\u023e\7t\2\2\u023e\u023f\7q\2\2\u023f\u0240\7y\2\2"+ - "\u0240\u0241\7u\2\2\u0241\\\3\2\2\2\u0242\u0243\7v\2\2\u0243\u0244\7t"+ - "\2\2\u0244\u0245\7c\2\2\u0245\u0246\7p\2\2\u0246\u0247\7u\2\2\u0247\u0248"+ - "\7k\2\2\u0248\u0249\7g\2\2\u0249\u024a\7p\2\2\u024a\u024b\7v\2\2\u024b"+ - "^\3\2\2\2\u024c\u024d\7v\2\2\u024d\u024e\7t\2\2\u024e\u024f\7{\2\2\u024f"+ - "`\3\2\2\2\u0250\u0251\7x\2\2\u0251\u0252\7q\2\2\u0252\u0253\7k\2\2\u0253"+ - "\u0254\7f\2\2\u0254b\3\2\2\2\u0255\u0256\7x\2\2\u0256\u0257\7q\2\2\u0257"+ - "\u0258\7n\2\2\u0258\u0259\7c\2\2\u0259\u025a\7v\2\2\u025a\u025b\7k\2\2"+ - "\u025b\u025c\7n\2\2\u025c\u025d\7g\2\2\u025dd\3\2\2\2\u025e\u025f\7y\2"+ - "\2\u025f\u0260\7j\2\2\u0260\u0261\7k\2\2\u0261\u0262\7n\2\2\u0262\u0263"+ - "\7g\2\2\u0263f\3\2\2\2\u0264\u0265\7o\2\2\u0265\u0266\7q\2\2\u0266\u0267"+ - "\7f\2\2\u0267\u0268\7w\2\2\u0268\u0269\7n\2\2\u0269\u026a\7g\2\2\u026a"+ - "h\3\2\2\2\u026b\u026c\7q\2\2\u026c\u026d\7r\2\2\u026d\u026e\7g\2\2\u026e"+ - "\u026f\7p\2\2\u026fj\3\2\2\2\u0270\u0271\7t\2\2\u0271\u0272\7g\2\2\u0272"+ - "\u0273\7s\2\2\u0273\u0274\7w\2\2\u0274\u0275\7k\2\2\u0275\u0276\7t\2\2"+ - "\u0276\u0277\7g\2\2\u0277\u0278\7u\2\2\u0278l\3\2\2\2\u0279\u027a\7g\2"+ - "\2\u027a\u027b\7z\2\2\u027b\u027c\7r\2\2\u027c\u027d\7q\2\2\u027d\u027e"+ - "\7t\2\2\u027e\u027f\7v\2\2\u027f\u0280\7u\2\2\u0280n\3\2\2\2\u0281\u0282"+ - "\7q\2\2\u0282\u0283\7r\2\2\u0283\u0284\7g\2\2\u0284\u0285\7p\2\2\u0285"+ - "\u0286\7u\2\2\u0286p\3\2\2\2\u0287\u0288\7v\2\2\u0288\u0289\7q\2\2\u0289"+ - "r\3\2\2\2\u028a\u028b\7w\2\2\u028b\u028c\7u\2\2\u028c\u028d\7g\2\2\u028d"+ - "\u028e\7u\2\2\u028et\3\2\2\2\u028f\u0290\7r\2\2\u0290\u0291\7t\2\2\u0291"+ - "\u0292\7q\2\2\u0292\u0293\7x\2\2\u0293\u0294\7k\2\2\u0294\u0295\7f\2\2"+ - "\u0295\u0296\7g\2\2\u0296\u0297\7u\2\2\u0297v\3\2\2\2\u0298\u0299\7y\2"+ - "\2\u0299\u029a\7k\2\2\u029a\u029b\7v\2\2\u029b\u029c\7j\2\2\u029cx\3\2"+ - "\2\2\u029d\u029e\7v\2\2\u029e\u029f\7t\2\2\u029f\u02a0\7c\2\2\u02a0\u02a1"+ - "\7p\2\2\u02a1\u02a2\7u\2\2\u02a2\u02a3\7k\2\2\u02a3\u02a4\7v\2\2\u02a4"+ - "\u02a5\7k\2\2\u02a5\u02a6\7x\2\2\u02a6\u02a7\7g\2\2\u02a7z\3\2\2\2\u02a8"+ - "\u02a9\7x\2\2\u02a9\u02aa\7c\2\2\u02aa\u02ab\7t\2\2\u02ab|\3\2\2\2\u02ac"+ - "\u02ad\7{\2\2\u02ad\u02ae\7k\2\2\u02ae\u02af\7g\2\2\u02af\u02b0\7n\2\2"+ - "\u02b0\u02b1\7f\2\2\u02b1~\3\2\2\2\u02b2\u02b3\7t\2\2\u02b3\u02b4\7g\2"+ - "\2\u02b4\u02b5\7e\2\2\u02b5\u02b6\7q\2\2\u02b6\u02b7\7t\2\2\u02b7\u02b8"+ - "\7f\2\2\u02b8\u0080\3\2\2\2\u02b9\u02ba\7u\2\2\u02ba\u02bb\7g\2\2\u02bb"+ - "\u02bc\7c\2\2\u02bc\u02bd\7n\2\2\u02bd\u02be\7g\2\2\u02be\u02bf\7f\2\2"+ - "\u02bf\u0082\3\2\2\2\u02c0\u02c1\7r\2\2\u02c1\u02c2\7g\2\2\u02c2\u02c3"+ - "\7t\2\2\u02c3\u02c4\7o\2\2\u02c4\u02c5\7k\2\2\u02c5\u02c6\7v\2\2\u02c6"+ - "\u02c7\7u\2\2\u02c7\u0084\3\2\2\2\u02c8\u02c9\7p\2\2\u02c9\u02ca\7q\2"+ - "\2\u02ca\u02cb\7p\2\2\u02cb\u02cc\7/\2\2\u02cc\u02cd\7u\2\2\u02cd\u02ce"+ - "\7g\2\2\u02ce\u02cf\7c\2\2\u02cf\u02d0\7n\2\2\u02d0\u02d1\7g\2\2\u02d1"+ - "\u02d2\7f\2\2\u02d2\u0086\3\2\2\2\u02d3\u02e1\7\62\2\2\u02d4\u02de\t\2"+ - "\2\2\u02d5\u02d7\5\u010b\u0086\2\u02d6\u02d5\3\2\2\2\u02d6\u02d7\3\2\2"+ - "\2\u02d7\u02df\3\2\2\2\u02d8\u02da\7a\2\2\u02d9\u02d8\3\2\2\2\u02da\u02db"+ - "\3\2\2\2\u02db\u02d9\3\2\2\2\u02db\u02dc\3\2\2\2\u02dc\u02dd\3\2\2\2\u02dd"+ - "\u02df\5\u010b\u0086\2\u02de\u02d6\3\2\2\2\u02de\u02d9\3\2\2\2\u02df\u02e1"+ - "\3\2\2\2\u02e0\u02d3\3\2\2\2\u02e0\u02d4\3\2\2\2\u02e1\u02e3\3\2\2\2\u02e2"+ - "\u02e4\t\3\2\2\u02e3\u02e2\3\2\2\2\u02e3\u02e4\3\2\2\2\u02e4\u0088\3\2"+ - "\2\2\u02e5\u02e6\7\62\2\2\u02e6\u02e7\t\4\2\2\u02e7\u02ef\t\5\2\2\u02e8"+ - "\u02ea\t\6\2\2\u02e9\u02e8\3\2\2\2\u02ea\u02ed\3\2\2\2\u02eb\u02e9\3\2"+ - "\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ee\3\2\2\2\u02ed\u02eb\3\2\2\2\u02ee"+ - "\u02f0\t\5\2\2\u02ef\u02eb\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0\u02f2\3\2"+ - "\2\2\u02f1\u02f3\t\3\2\2\u02f2\u02f1\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3"+ - "\u008a\3\2\2\2\u02f4\u02f8\7\62\2\2\u02f5\u02f7\7a\2\2\u02f6\u02f5\3\2"+ - "\2\2\u02f7\u02fa\3\2\2\2\u02f8\u02f6\3\2\2\2\u02f8\u02f9\3\2\2\2\u02f9"+ - "\u02fb\3\2\2\2\u02fa\u02f8\3\2\2\2\u02fb\u0303\t\7\2\2\u02fc\u02fe\t\b"+ - "\2\2\u02fd\u02fc\3\2\2\2\u02fe\u0301\3\2\2\2\u02ff\u02fd\3\2\2\2\u02ff"+ - "\u0300\3\2\2\2\u0300\u0302\3\2\2\2\u0301\u02ff\3\2\2\2\u0302\u0304\t\7"+ - "\2\2\u0303\u02ff\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u0306\3\2\2\2\u0305"+ - "\u0307\t\3\2\2\u0306\u0305\3\2\2\2\u0306\u0307\3\2\2\2\u0307\u008c\3\2"+ - "\2\2\u0308\u0309\7\62\2\2\u0309\u030a\t\t\2\2\u030a\u0312\t\n\2\2\u030b"+ - "\u030d\t\13\2\2\u030c\u030b\3\2\2\2\u030d\u0310\3\2\2\2\u030e\u030c\3"+ - "\2\2\2\u030e\u030f\3\2\2\2\u030f\u0311\3\2\2\2\u0310\u030e\3\2\2\2\u0311"+ - "\u0313\t\n\2\2\u0312\u030e\3\2\2\2\u0312\u0313\3\2\2\2\u0313\u0315\3\2"+ - "\2\2\u0314\u0316\t\3\2\2\u0315\u0314\3\2\2\2\u0315\u0316\3\2\2\2\u0316"+ - "\u008e\3\2\2\2\u0317\u0318\5\u010b\u0086\2\u0318\u031a\7\60\2\2\u0319"+ - "\u031b\5\u010b\u0086\2\u031a\u0319\3\2\2\2\u031a\u031b\3\2\2\2\u031b\u031f"+ - "\3\2\2\2\u031c\u031d\7\60\2\2\u031d\u031f\5\u010b\u0086\2\u031e\u0317"+ - "\3\2\2\2\u031e\u031c\3\2\2\2\u031f\u0321\3\2\2\2\u0320\u0322\5\u0103\u0082"+ - "\2\u0321\u0320\3\2\2\2\u0321\u0322\3\2\2\2\u0322\u0324\3\2\2\2\u0323\u0325"+ - "\t\f\2\2\u0324\u0323\3\2\2\2\u0324\u0325\3\2\2\2\u0325\u032f\3\2\2\2\u0326"+ - "\u032c\5\u010b\u0086\2\u0327\u0329\5\u0103\u0082\2\u0328\u032a\t\f\2\2"+ - "\u0329\u0328\3\2\2\2\u0329\u032a\3\2\2\2\u032a\u032d\3\2\2\2\u032b\u032d"+ - "\t\f\2\2\u032c\u0327\3\2\2\2\u032c\u032b\3\2\2\2\u032d\u032f\3\2\2\2\u032e"+ - "\u031e\3\2\2\2\u032e\u0326\3\2\2\2\u032f\u0090\3\2\2\2\u0330\u0331\7\62"+ - "\2\2\u0331\u033b\t\4\2\2\u0332\u0334\5\u0107\u0084\2\u0333\u0335\7\60"+ - "\2\2\u0334\u0333\3\2\2\2\u0334\u0335\3\2\2\2\u0335\u033c\3\2\2\2\u0336"+ - "\u0338\5\u0107\u0084\2\u0337\u0336\3\2\2\2\u0337\u0338\3\2\2\2\u0338\u0339"+ - "\3\2\2\2\u0339\u033a\7\60\2\2\u033a\u033c\5\u0107\u0084\2\u033b\u0332"+ - "\3\2\2\2\u033b\u0337\3\2\2\2\u033c\u033d\3\2\2\2\u033d\u033f\t\r\2\2\u033e"+ - "\u0340\t\16\2\2\u033f\u033e\3\2\2\2\u033f\u0340\3\2\2\2\u0340\u0341\3"+ - "\2\2\2\u0341\u0343\5\u010b\u0086\2\u0342\u0344\t\f\2\2\u0343\u0342\3\2"+ - "\2\2\u0343\u0344\3\2\2\2\u0344\u0092\3\2\2\2\u0345\u0346\7v\2\2\u0346"+ - "\u0347\7t\2\2\u0347\u0348\7w\2\2\u0348\u034f\7g\2\2\u0349\u034a\7h\2\2"+ - "\u034a\u034b\7c\2\2\u034b\u034c\7n\2\2\u034c\u034d\7u\2\2\u034d\u034f"+ - "\7g\2\2\u034e\u0345\3\2\2\2\u034e\u0349\3\2\2\2\u034f\u0094\3\2\2\2\u0350"+ - "\u0353\7)\2\2\u0351\u0354\n\17\2\2\u0352\u0354\5\u0105\u0083\2\u0353\u0351"+ - "\3\2\2\2\u0353\u0352\3\2\2\2\u0354\u0355\3\2\2\2\u0355\u0356\7)\2\2\u0356"+ - "\u0096\3\2\2\2\u0357\u035c\7$\2\2\u0358\u035b\n\20\2\2\u0359\u035b\5\u0105"+ - "\u0083\2\u035a\u0358\3\2\2\2\u035a\u0359\3\2\2\2\u035b\u035e\3\2\2\2\u035c"+ - "\u035a\3\2\2\2\u035c\u035d\3\2\2\2\u035d\u035f\3\2\2\2\u035e\u035c\3\2"+ - "\2\2\u035f\u0360\7$\2\2\u0360\u0098\3\2\2\2\u0361\u0362\7$\2\2\u0362\u0363"+ - "\7$\2\2\u0363\u0364\7$\2\2\u0364\u0368\3\2\2\2\u0365\u0367\t\21\2\2\u0366"+ - "\u0365\3\2\2\2\u0367\u036a\3\2\2\2\u0368\u0366\3\2\2\2\u0368\u0369\3\2"+ - "\2\2\u0369\u036b\3\2\2\2\u036a\u0368\3\2\2\2\u036b\u0370\t\22\2\2\u036c"+ - "\u036f\13\2\2\2\u036d\u036f\5\u0105\u0083\2\u036e\u036c\3\2\2\2\u036e"+ - "\u036d\3\2\2\2\u036f\u0372\3\2\2\2\u0370\u0371\3\2\2\2\u0370\u036e\3\2"+ - "\2\2\u0371\u0373\3\2\2\2\u0372\u0370\3\2\2\2\u0373\u0374\7$\2\2\u0374"+ - "\u0375\7$\2\2\u0375\u0376\7$\2\2\u0376\u009a\3\2\2\2\u0377\u0378\7p\2"+ - "\2\u0378\u0379\7w\2\2\u0379\u037a\7n\2\2\u037a\u037b\7n\2\2\u037b\u009c"+ - "\3\2\2\2\u037c\u037d\7*\2\2\u037d\u009e\3\2\2\2\u037e\u037f\7+\2\2\u037f"+ - "\u00a0\3\2\2\2\u0380\u0381\7}\2\2\u0381\u00a2\3\2\2\2\u0382\u0383\7\177"+ - "\2\2\u0383\u00a4\3\2\2\2\u0384\u0385\7]\2\2\u0385\u00a6\3\2\2\2\u0386"+ - "\u0387\7_\2\2\u0387\u00a8\3\2\2\2\u0388\u0389\7=\2\2\u0389\u00aa\3\2\2"+ - "\2\u038a\u038b\7.\2\2\u038b\u00ac\3\2\2\2\u038c\u038d\7\60\2\2\u038d\u00ae"+ - "\3\2\2\2\u038e\u038f\7?\2\2\u038f\u00b0\3\2\2\2\u0390\u0391\7@\2\2\u0391"+ - "\u00b2\3\2\2\2\u0392\u0393\7>\2\2\u0393\u00b4\3\2\2\2\u0394\u0395\7#\2"+ - "\2\u0395\u00b6\3\2\2\2\u0396\u0397\7\u0080\2\2\u0397\u00b8\3\2\2\2\u0398"+ - "\u0399\7A\2\2\u0399\u00ba\3\2\2\2\u039a\u039b\7<\2\2\u039b\u00bc\3\2\2"+ - "\2\u039c\u039d\7?\2\2\u039d\u039e\7?\2\2\u039e\u00be\3\2\2\2\u039f\u03a0"+ - "\7>\2\2\u03a0\u03a1\7?\2\2\u03a1\u00c0\3\2\2\2\u03a2\u03a3\7@\2\2\u03a3"+ - "\u03a4\7?\2\2\u03a4\u00c2\3\2\2\2\u03a5\u03a6\7#\2\2\u03a6\u03a7\7?\2"+ - "\2\u03a7\u00c4\3\2\2\2\u03a8\u03a9\7(\2\2\u03a9\u03aa\7(\2\2\u03aa\u00c6"+ - "\3\2\2\2\u03ab\u03ac\7~\2\2\u03ac\u03ad\7~\2\2\u03ad\u00c8\3\2\2\2\u03ae"+ - "\u03af\7-\2\2\u03af\u03b0\7-\2\2\u03b0\u00ca\3\2\2\2\u03b1\u03b2\7/\2"+ - "\2\u03b2\u03b3\7/\2\2\u03b3\u00cc\3\2\2\2\u03b4\u03b5\7-\2\2\u03b5\u00ce"+ - "\3\2\2\2\u03b6\u03b7\7/\2\2\u03b7\u00d0\3\2\2\2\u03b8\u03b9\7,\2\2\u03b9"+ - "\u00d2\3\2\2\2\u03ba\u03bb\7\61\2\2\u03bb\u00d4\3\2\2\2\u03bc\u03bd\7"+ - "(\2\2\u03bd\u00d6\3\2\2\2\u03be\u03bf\7~\2\2\u03bf\u00d8\3\2\2\2\u03c0"+ - "\u03c1\7`\2\2\u03c1\u00da\3\2\2\2\u03c2\u03c3\7\'\2\2\u03c3\u00dc\3\2"+ - "\2\2\u03c4\u03c5\7-\2\2\u03c5\u03c6\7?\2\2\u03c6\u00de\3\2\2\2\u03c7\u03c8"+ - "\7/\2\2\u03c8\u03c9\7?\2\2\u03c9\u00e0\3\2\2\2\u03ca\u03cb\7,\2\2\u03cb"+ - "\u03cc\7?\2\2\u03cc\u00e2\3\2\2\2\u03cd\u03ce\7\61\2\2\u03ce\u03cf\7?"+ - "\2\2\u03cf\u00e4\3\2\2\2\u03d0\u03d1\7(\2\2\u03d1\u03d2\7?\2\2\u03d2\u00e6"+ - "\3\2\2\2\u03d3\u03d4\7~\2\2\u03d4\u03d5\7?\2\2\u03d5\u00e8\3\2\2\2\u03d6"+ - "\u03d7\7`\2\2\u03d7\u03d8\7?\2\2\u03d8\u00ea\3\2\2\2\u03d9\u03da\7\'\2"+ - "\2\u03da\u03db\7?\2\2\u03db\u00ec\3\2\2\2\u03dc\u03dd\7>\2\2\u03dd\u03de"+ - "\7>\2\2\u03de\u03df\7?\2\2\u03df\u00ee\3\2\2\2\u03e0\u03e1\7@\2\2\u03e1"+ - "\u03e2\7@\2\2\u03e2\u03e3\7?\2\2\u03e3\u00f0\3\2\2\2\u03e4\u03e5\7@\2"+ - "\2\u03e5\u03e6\7@\2\2\u03e6\u03e7\7@\2\2\u03e7\u03e8\7?\2\2\u03e8\u00f2"+ - "\3\2\2\2\u03e9\u03ea\7/\2\2\u03ea\u03eb\7@\2\2\u03eb\u00f4\3\2\2\2\u03ec"+ - "\u03ed\7<\2\2\u03ed\u03ee\7<\2\2\u03ee\u00f6\3\2\2\2\u03ef\u03f0\7B\2"+ - "\2\u03f0\u00f8\3\2\2\2\u03f1\u03f2\7\60\2\2\u03f2\u03f3\7\60\2\2\u03f3"+ - "\u03f4\7\60\2\2\u03f4\u00fa\3\2\2\2\u03f5\u03f7\t\23\2\2\u03f6\u03f5\3"+ - "\2\2\2\u03f7\u03f8\3\2\2\2\u03f8\u03f6\3\2\2\2\u03f8\u03f9\3\2\2\2\u03f9"+ - "\u03fa\3\2\2\2\u03fa\u03fb\b~\2\2\u03fb\u00fc\3\2\2\2\u03fc\u03fd\7\61"+ - "\2\2\u03fd\u03fe\7,\2\2\u03fe\u0402\3\2\2\2\u03ff\u0401\13\2\2\2\u0400"+ - "\u03ff\3\2\2\2\u0401\u0404\3\2\2\2\u0402\u0403\3\2\2\2\u0402\u0400\3\2"+ - "\2\2\u0403\u0405\3\2\2\2\u0404\u0402\3\2\2\2\u0405\u0406\7,\2\2\u0406"+ - "\u0407\7\61\2\2\u0407\u0408\3\2\2\2\u0408\u0409\b\177\2\2\u0409\u00fe"+ - "\3\2\2\2\u040a\u040b\7\61\2\2\u040b\u040c\7\61\2\2\u040c\u0410\3\2\2\2"+ - "\u040d\u040f\n\22\2\2\u040e\u040d\3\2\2\2\u040f\u0412\3\2\2\2\u0410\u040e"+ - "\3\2\2\2\u0410\u0411\3\2\2\2\u0411\u0413\3\2\2\2\u0412\u0410\3\2\2\2\u0413"+ - "\u0414\b\u0080\2\2\u0414\u0100\3\2\2\2\u0415\u0419\5\u010f\u0088\2\u0416"+ - "\u0418\5\u010d\u0087\2\u0417\u0416\3\2\2\2\u0418\u041b\3\2\2\2\u0419\u0417"+ - "\3\2\2\2\u0419\u041a\3\2\2\2\u041a\u0102\3\2\2\2\u041b\u0419\3\2\2\2\u041c"+ - "\u041e\t\24\2\2\u041d\u041f\t\16\2\2\u041e\u041d\3\2\2\2\u041e\u041f\3"+ - "\2\2\2\u041f\u0420\3\2\2\2\u0420\u0421\5\u010b\u0086\2\u0421\u0104\3\2"+ - "\2\2\u0422\u0423\7^\2\2\u0423\u0438\t\25\2\2\u0424\u0429\7^\2\2\u0425"+ - "\u0427\t\26\2\2\u0426\u0425\3\2\2\2\u0426\u0427\3\2\2\2\u0427\u0428\3"+ - "\2\2\2\u0428\u042a\t\7\2\2\u0429\u0426\3\2\2\2\u0429\u042a\3\2\2\2\u042a"+ - "\u042b\3\2\2\2\u042b\u0438\t\7\2\2\u042c\u042e\7^\2\2\u042d\u042f\7w\2"+ - "\2\u042e\u042d\3\2\2\2\u042f\u0430\3\2\2\2\u0430\u042e\3\2\2\2\u0430\u0431"+ - "\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\5\u0109\u0085\2\u0433\u0434\5"+ - "\u0109\u0085\2\u0434\u0435\5\u0109\u0085\2\u0435\u0436\5\u0109\u0085\2"+ - "\u0436\u0438\3\2\2\2\u0437\u0422\3\2\2\2\u0437\u0424\3\2\2\2\u0437\u042c"+ - "\3\2\2\2\u0438\u0106\3\2\2\2\u0439\u0442\5\u0109\u0085\2\u043a\u043d\5"+ - "\u0109\u0085\2\u043b\u043d\7a\2\2\u043c\u043a\3\2\2\2\u043c\u043b\3\2"+ - "\2\2\u043d\u0440\3\2\2\2\u043e\u043c\3\2\2\2\u043e\u043f\3\2\2\2\u043f"+ - "\u0441\3\2\2\2\u0440\u043e\3\2\2\2\u0441\u0443\5\u0109\u0085\2\u0442\u043e"+ - "\3\2\2\2\u0442\u0443\3\2\2\2\u0443\u0108\3\2\2\2\u0444\u0445\t\5\2\2\u0445"+ - "\u010a\3\2\2\2\u0446\u044e\t\27\2\2\u0447\u0449\t\30\2\2\u0448\u0447\3"+ - "\2\2\2\u0449\u044c\3\2\2\2\u044a\u0448\3\2\2\2\u044a\u044b\3\2\2\2\u044b"+ - "\u044d\3\2\2\2\u044c\u044a\3\2\2\2\u044d\u044f\t\27\2\2\u044e\u044a\3"+ - "\2\2\2\u044e\u044f\3\2\2\2\u044f\u010c\3\2\2\2\u0450\u0453\5\u010f\u0088"+ - "\2\u0451\u0453\t\27\2\2\u0452\u0450\3\2\2\2\u0452\u0451\3\2\2\2\u0453"+ - "\u010e\3\2\2\2\u0454\u0459\t\31\2\2\u0455\u0459\n\32\2\2\u0456\u0457\t"+ - "\33\2\2\u0457\u0459\t\34\2\2\u0458\u0454\3\2\2\2\u0458\u0455\3\2\2\2\u0458"+ - "\u0456\3\2\2\2\u0459\u0110\3\2\2\2\65\2\u02d6\u02db\u02de\u02e0\u02e3"+ - "\u02eb\u02ef\u02f2\u02f8\u02ff\u0303\u0306\u030e\u0312\u0315\u031a\u031e"+ - "\u0321\u0324\u0329\u032c\u032e\u0334\u0337\u033b\u033f\u0343\u034e\u0353"+ - "\u035a\u035c\u0368\u036e\u0370\u03f8\u0402\u0410\u0419\u041e\u0426\u0429"+ - "\u0430\u0437\u043c\u043e\u0442\u044a\u044e\u0452\u0458\3\2\3\2"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens b/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens deleted file mode 100644 index f811013a..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaLexer.tokens +++ /dev/null @@ -1,242 +0,0 @@ -ABSTRACT=1 -ASSERT=2 -BOOLEAN=3 -BREAK=4 -BYTE=5 -CASE=6 -CATCH=7 -CHAR=8 -CLASS=9 -CONST=10 -CONTINUE=11 -DEFAULT=12 -DO=13 -DOUBLE=14 -ELSE=15 -ENUM=16 -EXTENDS=17 -FINAL=18 -FINALLY=19 -FLOAT=20 -FOR=21 -IF=22 -GOTO=23 -IMPLEMENTS=24 -IMPORT=25 -INSTANCEOF=26 -INT=27 -INTERFACE=28 -LONG=29 -NATIVE=30 -NEW=31 -PACKAGE=32 -PRIVATE=33 -PROTECTED=34 -PUBLIC=35 -RETURN=36 -SHORT=37 -STATIC=38 -STRICTFP=39 -SUPER=40 -SWITCH=41 -SYNCHRONIZED=42 -THIS=43 -THROW=44 -THROWS=45 -TRANSIENT=46 -TRY=47 -VOID=48 -VOLATILE=49 -WHILE=50 -MODULE=51 -OPEN=52 -REQUIRES=53 -EXPORTS=54 -OPENS=55 -TO=56 -USES=57 -PROVIDES=58 -WITH=59 -TRANSITIVE=60 -VAR=61 -YIELD=62 -RECORD=63 -SEALED=64 -PERMITS=65 -NON_SEALED=66 -DECIMAL_LITERAL=67 -HEX_LITERAL=68 -OCT_LITERAL=69 -BINARY_LITERAL=70 -FLOAT_LITERAL=71 -HEX_FLOAT_LITERAL=72 -BOOL_LITERAL=73 -CHAR_LITERAL=74 -STRING_LITERAL=75 -TEXT_BLOCK=76 -NULL_LITERAL=77 -LPAREN=78 -RPAREN=79 -LBRACE=80 -RBRACE=81 -LBRACK=82 -RBRACK=83 -SEMI=84 -COMMA=85 -DOT=86 -ASSIGN=87 -GT=88 -LT=89 -BANG=90 -TILDE=91 -QUESTION=92 -COLON=93 -EQUAL=94 -LE=95 -GE=96 -NOTEQUAL=97 -AND=98 -OR=99 -INC=100 -DEC=101 -ADD=102 -SUB=103 -MUL=104 -DIV=105 -BITAND=106 -BITOR=107 -CARET=108 -MOD=109 -ADD_ASSIGN=110 -SUB_ASSIGN=111 -MUL_ASSIGN=112 -DIV_ASSIGN=113 -AND_ASSIGN=114 -OR_ASSIGN=115 -XOR_ASSIGN=116 -MOD_ASSIGN=117 -LSHIFT_ASSIGN=118 -RSHIFT_ASSIGN=119 -URSHIFT_ASSIGN=120 -ARROW=121 -COLONCOLON=122 -AT=123 -ELLIPSIS=124 -WS=125 -COMMENT=126 -LINE_COMMENT=127 -IDENTIFIER=128 -'abstract'=1 -'assert'=2 -'boolean'=3 -'break'=4 -'byte'=5 -'case'=6 -'catch'=7 -'char'=8 -'class'=9 -'const'=10 -'continue'=11 -'default'=12 -'do'=13 -'double'=14 -'else'=15 -'enum'=16 -'extends'=17 -'final'=18 -'finally'=19 -'float'=20 -'for'=21 -'if'=22 -'goto'=23 -'implements'=24 -'import'=25 -'instanceof'=26 -'int'=27 -'interface'=28 -'long'=29 -'native'=30 -'new'=31 -'package'=32 -'private'=33 -'protected'=34 -'public'=35 -'return'=36 -'short'=37 -'static'=38 -'strictfp'=39 -'super'=40 -'switch'=41 -'synchronized'=42 -'this'=43 -'throw'=44 -'throws'=45 -'transient'=46 -'try'=47 -'void'=48 -'volatile'=49 -'while'=50 -'module'=51 -'open'=52 -'requires'=53 -'exports'=54 -'opens'=55 -'to'=56 -'uses'=57 -'provides'=58 -'with'=59 -'transitive'=60 -'var'=61 -'yield'=62 -'record'=63 -'sealed'=64 -'permits'=65 -'non-sealed'=66 -'null'=77 -'('=78 -')'=79 -'{'=80 -'}'=81 -'['=82 -']'=83 -';'=84 -','=85 -'.'=86 -'='=87 -'>'=88 -'<'=89 -'!'=90 -'~'=91 -'?'=92 -':'=93 -'=='=94 -'<='=95 -'>='=96 -'!='=97 -'&&'=98 -'||'=99 -'++'=100 -'--'=101 -'+'=102 -'-'=103 -'*'=104 -'/'=105 -'&'=106 -'|'=107 -'^'=108 -'%'=109 -'+='=110 -'-='=111 -'*='=112 -'/='=113 -'&='=114 -'|='=115 -'^='=116 -'%='=117 -'<<='=118 -'>>='=119 -'>>>='=120 -'->'=121 -'::'=122 -'@'=123 -'...'=124 diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp deleted file mode 100644 index 522aeebf..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.interp +++ /dev/null @@ -1,275 +0,0 @@ -token literal names: -null -'abstract' -'assert' -'boolean' -'break' -'byte' -'case' -'catch' -'char' -'class' -'const' -'continue' -'default' -'do' -'double' -'else' -'enum' -'extends' -'final' -'finally' -'float' -'for' -'if' -'goto' -'implements' -'import' -'instanceof' -'int' -'interface' -'long' -'native' -'new' -'package' -'private' -'protected' -'public' -'return' -'short' -'static' -'strictfp' -'super' -'switch' -'synchronized' -'this' -'throw' -'throws' -'transient' -'try' -'void' -'volatile' -'while' -'module' -'open' -'requires' -'exports' -'opens' -'to' -'uses' -'provides' -'with' -'transitive' -'var' -'yield' -'record' -'sealed' -'permits' -'non-sealed' -null -null -null -null -null -null -null -null -null -null -'null' -'(' -')' -'{' -'}' -'[' -']' -';' -',' -'.' -'=' -'>' -'<' -'!' -'~' -'?' -':' -'==' -'<=' -'>=' -'!=' -'&&' -'||' -'++' -'--' -'+' -'-' -'*' -'/' -'&' -'|' -'^' -'%' -'+=' -'-=' -'*=' -'/=' -'&=' -'|=' -'^=' -'%=' -'<<=' -'>>=' -'>>>=' -'->' -'::' -'@' -'...' -null -null -null -null - -token symbolic names: -null -ABSTRACT -ASSERT -BOOLEAN -BREAK -BYTE -CASE -CATCH -CHAR -CLASS -CONST -CONTINUE -DEFAULT -DO -DOUBLE -ELSE -ENUM -EXTENDS -FINAL -FINALLY -FLOAT -FOR -IF -GOTO -IMPLEMENTS -IMPORT -INSTANCEOF -INT -INTERFACE -LONG -NATIVE -NEW -PACKAGE -PRIVATE -PROTECTED -PUBLIC -RETURN -SHORT -STATIC -STRICTFP -SUPER -SWITCH -SYNCHRONIZED -THIS -THROW -THROWS -TRANSIENT -TRY -VOID -VOLATILE -WHILE -MODULE -OPEN -REQUIRES -EXPORTS -OPENS -TO -USES -PROVIDES -WITH -TRANSITIVE -VAR -YIELD -RECORD -SEALED -PERMITS -NON_SEALED -DECIMAL_LITERAL -HEX_LITERAL -OCT_LITERAL -BINARY_LITERAL -FLOAT_LITERAL -HEX_FLOAT_LITERAL -BOOL_LITERAL -CHAR_LITERAL -STRING_LITERAL -TEXT_BLOCK -NULL_LITERAL -LPAREN -RPAREN -LBRACE -RBRACE -LBRACK -RBRACK -SEMI -COMMA -DOT -ASSIGN -GT -LT -BANG -TILDE -QUESTION -COLON -EQUAL -LE -GE -NOTEQUAL -AND -OR -INC -DEC -ADD -SUB -MUL -DIV -BITAND -BITOR -CARET -MOD -ADD_ASSIGN -SUB_ASSIGN -MUL_ASSIGN -DIV_ASSIGN -AND_ASSIGN -OR_ASSIGN -XOR_ASSIGN -MOD_ASSIGN -LSHIFT_ASSIGN -RSHIFT_ASSIGN -URSHIFT_ASSIGN -ARROW -COLONCOLON -AT -ELLIPSIS -WS -COMMENT -LINE_COMMENT -IDENTIFIER - -rule names: -expression -primary -methodCall -identifier -literal -integerLiteral -floatLiteral -expressionList - - -atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 130, 148, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 42, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 80, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 89, 10, 2, 12, 2, 14, 2, 92, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 102, 10, 3, 3, 4, 3, 4, 3, 4, 5, 4, 107, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 114, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 120, 10, 4, 3, 4, 5, 4, 123, 10, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 134, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 143, 10, 9, 12, 9, 14, 9, 146, 11, 9, 3, 9, 2, 3, 2, 10, 2, 4, 6, 8, 10, 12, 14, 16, 2, 13, 3, 2, 102, 105, 3, 2, 92, 93, 4, 2, 106, 107, 111, 111, 3, 2, 104, 105, 4, 2, 90, 91, 97, 98, 4, 2, 96, 96, 99, 99, 4, 2, 89, 89, 112, 122, 3, 2, 102, 103, 4, 2, 53, 67, 130, 130, 3, 2, 69, 72, 3, 2, 73, 74, 2, 177, 2, 25, 3, 2, 2, 2, 4, 101, 3, 2, 2, 2, 6, 122, 3, 2, 2, 2, 8, 124, 3, 2, 2, 2, 10, 133, 3, 2, 2, 2, 12, 135, 3, 2, 2, 2, 14, 137, 3, 2, 2, 2, 16, 139, 3, 2, 2, 2, 18, 19, 8, 2, 1, 2, 19, 26, 5, 4, 3, 2, 20, 26, 5, 6, 4, 2, 21, 22, 9, 2, 2, 2, 22, 26, 5, 2, 2, 16, 23, 24, 9, 3, 2, 2, 24, 26, 5, 2, 2, 15, 25, 18, 3, 2, 2, 2, 25, 20, 3, 2, 2, 2, 25, 21, 3, 2, 2, 2, 25, 23, 3, 2, 2, 2, 26, 90, 3, 2, 2, 2, 27, 28, 12, 14, 2, 2, 28, 29, 9, 4, 2, 2, 29, 89, 5, 2, 2, 15, 30, 31, 12, 13, 2, 2, 31, 32, 9, 5, 2, 2, 32, 89, 5, 2, 2, 14, 33, 41, 12, 12, 2, 2, 34, 35, 7, 91, 2, 2, 35, 42, 7, 91, 2, 2, 36, 37, 7, 90, 2, 2, 37, 38, 7, 90, 2, 2, 38, 42, 7, 90, 2, 2, 39, 40, 7, 90, 2, 2, 40, 42, 7, 90, 2, 2, 41, 34, 3, 2, 2, 2, 41, 36, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 89, 5, 2, 2, 13, 44, 45, 12, 11, 2, 2, 45, 46, 9, 6, 2, 2, 46, 89, 5, 2, 2, 12, 47, 48, 12, 10, 2, 2, 48, 49, 9, 7, 2, 2, 49, 89, 5, 2, 2, 11, 50, 51, 12, 9, 2, 2, 51, 52, 7, 108, 2, 2, 52, 89, 5, 2, 2, 10, 53, 54, 12, 8, 2, 2, 54, 55, 7, 110, 2, 2, 55, 89, 5, 2, 2, 9, 56, 57, 12, 7, 2, 2, 57, 58, 7, 109, 2, 2, 58, 89, 5, 2, 2, 8, 59, 60, 12, 6, 2, 2, 60, 61, 7, 100, 2, 2, 61, 89, 5, 2, 2, 7, 62, 63, 12, 5, 2, 2, 63, 64, 7, 101, 2, 2, 64, 89, 5, 2, 2, 6, 65, 66, 12, 4, 2, 2, 66, 67, 7, 94, 2, 2, 67, 68, 5, 2, 2, 2, 68, 69, 7, 95, 2, 2, 69, 70, 5, 2, 2, 4, 70, 89, 3, 2, 2, 2, 71, 72, 12, 3, 2, 2, 72, 73, 9, 8, 2, 2, 73, 89, 5, 2, 2, 3, 74, 75, 12, 20, 2, 2, 75, 79, 7, 88, 2, 2, 76, 80, 5, 8, 5, 2, 77, 80, 5, 6, 4, 2, 78, 80, 7, 45, 2, 2, 79, 76, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 78, 3, 2, 2, 2, 80, 89, 3, 2, 2, 2, 81, 82, 12, 19, 2, 2, 82, 83, 7, 84, 2, 2, 83, 84, 5, 2, 2, 2, 84, 85, 7, 85, 2, 2, 85, 89, 3, 2, 2, 2, 86, 87, 12, 17, 2, 2, 87, 89, 9, 9, 2, 2, 88, 27, 3, 2, 2, 2, 88, 30, 3, 2, 2, 2, 88, 33, 3, 2, 2, 2, 88, 44, 3, 2, 2, 2, 88, 47, 3, 2, 2, 2, 88, 50, 3, 2, 2, 2, 88, 53, 3, 2, 2, 2, 88, 56, 3, 2, 2, 2, 88, 59, 3, 2, 2, 2, 88, 62, 3, 2, 2, 2, 88, 65, 3, 2, 2, 2, 88, 71, 3, 2, 2, 2, 88, 74, 3, 2, 2, 2, 88, 81, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 3, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 94, 7, 80, 2, 2, 94, 95, 5, 2, 2, 2, 95, 96, 7, 81, 2, 2, 96, 102, 3, 2, 2, 2, 97, 102, 7, 45, 2, 2, 98, 102, 7, 42, 2, 2, 99, 102, 5, 10, 6, 2, 100, 102, 5, 8, 5, 2, 101, 93, 3, 2, 2, 2, 101, 97, 3, 2, 2, 2, 101, 98, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 101, 100, 3, 2, 2, 2, 102, 5, 3, 2, 2, 2, 103, 104, 5, 8, 5, 2, 104, 106, 7, 80, 2, 2, 105, 107, 5, 16, 9, 2, 106, 105, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 7, 81, 2, 2, 109, 123, 3, 2, 2, 2, 110, 111, 7, 45, 2, 2, 111, 113, 7, 80, 2, 2, 112, 114, 5, 16, 9, 2, 113, 112, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 123, 7, 81, 2, 2, 116, 117, 7, 42, 2, 2, 117, 119, 7, 80, 2, 2, 118, 120, 5, 16, 9, 2, 119, 118, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 123, 7, 81, 2, 2, 122, 103, 3, 2, 2, 2, 122, 110, 3, 2, 2, 2, 122, 116, 3, 2, 2, 2, 123, 7, 3, 2, 2, 2, 124, 125, 9, 10, 2, 2, 125, 9, 3, 2, 2, 2, 126, 134, 5, 12, 7, 2, 127, 134, 5, 14, 8, 2, 128, 134, 7, 76, 2, 2, 129, 134, 7, 77, 2, 2, 130, 134, 7, 75, 2, 2, 131, 134, 7, 79, 2, 2, 132, 134, 7, 78, 2, 2, 133, 126, 3, 2, 2, 2, 133, 127, 3, 2, 2, 2, 133, 128, 3, 2, 2, 2, 133, 129, 3, 2, 2, 2, 133, 130, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 132, 3, 2, 2, 2, 134, 11, 3, 2, 2, 2, 135, 136, 9, 11, 2, 2, 136, 13, 3, 2, 2, 2, 137, 138, 9, 12, 2, 2, 138, 15, 3, 2, 2, 2, 139, 144, 5, 2, 2, 2, 140, 141, 7, 87, 2, 2, 141, 143, 5, 2, 2, 2, 142, 140, 3, 2, 2, 2, 143, 146, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 17, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 14, 25, 41, 79, 88, 90, 101, 106, 113, 119, 122, 133, 144] \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens b/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens deleted file mode 100644 index f811013a..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParser.tokens +++ /dev/null @@ -1,242 +0,0 @@ -ABSTRACT=1 -ASSERT=2 -BOOLEAN=3 -BREAK=4 -BYTE=5 -CASE=6 -CATCH=7 -CHAR=8 -CLASS=9 -CONST=10 -CONTINUE=11 -DEFAULT=12 -DO=13 -DOUBLE=14 -ELSE=15 -ENUM=16 -EXTENDS=17 -FINAL=18 -FINALLY=19 -FLOAT=20 -FOR=21 -IF=22 -GOTO=23 -IMPLEMENTS=24 -IMPORT=25 -INSTANCEOF=26 -INT=27 -INTERFACE=28 -LONG=29 -NATIVE=30 -NEW=31 -PACKAGE=32 -PRIVATE=33 -PROTECTED=34 -PUBLIC=35 -RETURN=36 -SHORT=37 -STATIC=38 -STRICTFP=39 -SUPER=40 -SWITCH=41 -SYNCHRONIZED=42 -THIS=43 -THROW=44 -THROWS=45 -TRANSIENT=46 -TRY=47 -VOID=48 -VOLATILE=49 -WHILE=50 -MODULE=51 -OPEN=52 -REQUIRES=53 -EXPORTS=54 -OPENS=55 -TO=56 -USES=57 -PROVIDES=58 -WITH=59 -TRANSITIVE=60 -VAR=61 -YIELD=62 -RECORD=63 -SEALED=64 -PERMITS=65 -NON_SEALED=66 -DECIMAL_LITERAL=67 -HEX_LITERAL=68 -OCT_LITERAL=69 -BINARY_LITERAL=70 -FLOAT_LITERAL=71 -HEX_FLOAT_LITERAL=72 -BOOL_LITERAL=73 -CHAR_LITERAL=74 -STRING_LITERAL=75 -TEXT_BLOCK=76 -NULL_LITERAL=77 -LPAREN=78 -RPAREN=79 -LBRACE=80 -RBRACE=81 -LBRACK=82 -RBRACK=83 -SEMI=84 -COMMA=85 -DOT=86 -ASSIGN=87 -GT=88 -LT=89 -BANG=90 -TILDE=91 -QUESTION=92 -COLON=93 -EQUAL=94 -LE=95 -GE=96 -NOTEQUAL=97 -AND=98 -OR=99 -INC=100 -DEC=101 -ADD=102 -SUB=103 -MUL=104 -DIV=105 -BITAND=106 -BITOR=107 -CARET=108 -MOD=109 -ADD_ASSIGN=110 -SUB_ASSIGN=111 -MUL_ASSIGN=112 -DIV_ASSIGN=113 -AND_ASSIGN=114 -OR_ASSIGN=115 -XOR_ASSIGN=116 -MOD_ASSIGN=117 -LSHIFT_ASSIGN=118 -RSHIFT_ASSIGN=119 -URSHIFT_ASSIGN=120 -ARROW=121 -COLONCOLON=122 -AT=123 -ELLIPSIS=124 -WS=125 -COMMENT=126 -LINE_COMMENT=127 -IDENTIFIER=128 -'abstract'=1 -'assert'=2 -'boolean'=3 -'break'=4 -'byte'=5 -'case'=6 -'catch'=7 -'char'=8 -'class'=9 -'const'=10 -'continue'=11 -'default'=12 -'do'=13 -'double'=14 -'else'=15 -'enum'=16 -'extends'=17 -'final'=18 -'finally'=19 -'float'=20 -'for'=21 -'if'=22 -'goto'=23 -'implements'=24 -'import'=25 -'instanceof'=26 -'int'=27 -'interface'=28 -'long'=29 -'native'=30 -'new'=31 -'package'=32 -'private'=33 -'protected'=34 -'public'=35 -'return'=36 -'short'=37 -'static'=38 -'strictfp'=39 -'super'=40 -'switch'=41 -'synchronized'=42 -'this'=43 -'throw'=44 -'throws'=45 -'transient'=46 -'try'=47 -'void'=48 -'volatile'=49 -'while'=50 -'module'=51 -'open'=52 -'requires'=53 -'exports'=54 -'opens'=55 -'to'=56 -'uses'=57 -'provides'=58 -'with'=59 -'transitive'=60 -'var'=61 -'yield'=62 -'record'=63 -'sealed'=64 -'permits'=65 -'non-sealed'=66 -'null'=77 -'('=78 -')'=79 -'{'=80 -'}'=81 -'['=82 -']'=83 -';'=84 -','=85 -'.'=86 -'='=87 -'>'=88 -'<'=89 -'!'=90 -'~'=91 -'?'=92 -':'=93 -'=='=94 -'<='=95 -'>='=96 -'!='=97 -'&&'=98 -'||'=99 -'++'=100 -'--'=101 -'+'=102 -'-'=103 -'*'=104 -'/'=105 -'&'=106 -'|'=107 -'^'=108 -'%'=109 -'+='=110 -'-='=111 -'*='=112 -'/='=113 -'&='=114 -'|='=115 -'^='=116 -'%='=117 -'<<='=118 -'>>='=119 -'>>>='=120 -'->'=121 -'::'=122 -'@'=123 -'...'=124 diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java deleted file mode 100644 index a5ff0453..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseListener.java +++ /dev/null @@ -1,135 +0,0 @@ -// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 -package org.javabip.verification.parser; - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ErrorNode; -import org.antlr.v4.runtime.tree.TerminalNode; - -/** - * This class provides an empty implementation of {@link JavaParserListener}, - * which can be extended to create a listener which only needs to handle a subset - * of the available methods. - */ -public class JavaParserBaseListener implements JavaParserListener { - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterExpression(JavaParser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitExpression(JavaParser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterPrimary(JavaParser.PrimaryContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitPrimary(JavaParser.PrimaryContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMethodCall(JavaParser.MethodCallContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMethodCall(JavaParser.MethodCallContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterIdentifier(JavaParser.IdentifierContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitIdentifier(JavaParser.IdentifierContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterLiteral(JavaParser.LiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitLiteral(JavaParser.LiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterFloatLiteral(JavaParser.FloatLiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitFloatLiteral(JavaParser.FloatLiteralContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterExpressionList(JavaParser.ExpressionListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitExpressionList(JavaParser.ExpressionListContext ctx) { } - - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitTerminal(TerminalNode node) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitErrorNode(ErrorNode node) { } -} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java deleted file mode 100644 index 7520a4c4..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserBaseVisitor.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 -package org.javabip.verification.parser; -import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; - -/** - * This class provides an empty implementation of {@link JavaParserVisitor}, - * which can be extended to create a visitor which only needs to handle a subset - * of the available methods. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public class JavaParserBaseVisitor extends AbstractParseTreeVisitor implements JavaParserVisitor { - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExpression(JavaParser.ExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPrimary(JavaParser.PrimaryContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMethodCall(JavaParser.MethodCallContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitIdentifier(JavaParser.IdentifierContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLiteral(JavaParser.LiteralContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFloatLiteral(JavaParser.FloatLiteralContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExpressionList(JavaParser.ExpressionListContext ctx) { return visitChildren(ctx); } -} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java deleted file mode 100644 index b2a9fd90..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserListener.java +++ /dev/null @@ -1,90 +0,0 @@ -// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 -package org.javabip.verification.parser; -import org.antlr.v4.runtime.tree.ParseTreeListener; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link JavaParser}. - */ -public interface JavaParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by {@link JavaParser#expression}. - * @param ctx the parse tree - */ - void enterExpression(JavaParser.ExpressionContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#expression}. - * @param ctx the parse tree - */ - void exitExpression(JavaParser.ExpressionContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#primary}. - * @param ctx the parse tree - */ - void enterPrimary(JavaParser.PrimaryContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#primary}. - * @param ctx the parse tree - */ - void exitPrimary(JavaParser.PrimaryContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#methodCall}. - * @param ctx the parse tree - */ - void enterMethodCall(JavaParser.MethodCallContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#methodCall}. - * @param ctx the parse tree - */ - void exitMethodCall(JavaParser.MethodCallContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#identifier}. - * @param ctx the parse tree - */ - void enterIdentifier(JavaParser.IdentifierContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#identifier}. - * @param ctx the parse tree - */ - void exitIdentifier(JavaParser.IdentifierContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#literal}. - * @param ctx the parse tree - */ - void enterLiteral(JavaParser.LiteralContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#literal}. - * @param ctx the parse tree - */ - void exitLiteral(JavaParser.LiteralContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#integerLiteral}. - * @param ctx the parse tree - */ - void enterIntegerLiteral(JavaParser.IntegerLiteralContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#integerLiteral}. - * @param ctx the parse tree - */ - void exitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#floatLiteral}. - * @param ctx the parse tree - */ - void enterFloatLiteral(JavaParser.FloatLiteralContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#floatLiteral}. - * @param ctx the parse tree - */ - void exitFloatLiteral(JavaParser.FloatLiteralContext ctx); - /** - * Enter a parse tree produced by {@link JavaParser#expressionList}. - * @param ctx the parse tree - */ - void enterExpressionList(JavaParser.ExpressionListContext ctx); - /** - * Exit a parse tree produced by {@link JavaParser#expressionList}. - * @param ctx the parse tree - */ - void exitExpressionList(JavaParser.ExpressionListContext ctx); -} \ No newline at end of file diff --git a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java b/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java deleted file mode 100644 index 8ebd85c0..00000000 --- a/org.javabip.api/gen/org/javabip/verification/parser/JavaParserVisitor.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated from /Users/lsafina/Projects/javabip-core/org.javabip.api/src/main/java/org/javabip/verification/parser/JavaParser.g4 by ANTLR 4.9.2 -package org.javabip.verification.parser; -import org.antlr.v4.runtime.tree.ParseTreeVisitor; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link JavaParser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface JavaParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by {@link JavaParser#expression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpression(JavaParser.ExpressionContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#primary}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPrimary(JavaParser.PrimaryContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#methodCall}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMethodCall(JavaParser.MethodCallContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#identifier}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitIdentifier(JavaParser.IdentifierContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#literal}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLiteral(JavaParser.LiteralContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#integerLiteral}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitIntegerLiteral(JavaParser.IntegerLiteralContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#floatLiteral}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFloatLiteral(JavaParser.FloatLiteralContext ctx); - /** - * Visit a parse tree produced by {@link JavaParser#expressionList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpressionList(JavaParser.ExpressionListContext ctx); -} \ No newline at end of file