strings = Transpiler.transpile(qname, map.keySet(), fl.getSource());
+ logger.debug("Successful transpilation");
+ String fname = strings.remove(0);
+ String compiled = strings.remove(0);
+
+ FlowMetadata meta = fl.getMetadata();
+ meta.setFuncName(fname);
+ meta.setInputs(strings);
+
+ fl.setMetadata(meta);
+ fl.setTranspiled(compiled);
+ fl.setTransHash(futils.hash(compiled));
+ fl.setCodeError(null);
+
+ logger.debug("Persisting changes...");
+ entryManager.merge(fl);
+
+ } catch (SyntaxException se) {
+ try {
+ error = mapper.writeValueAsString(se);
+ shortError = se.getMessage();
+ } catch(JsonProcessingException je) {
+ error = je.getMessage();
+ }
+ } catch (TranspilerException te) {
+ error = te.getMessage();
+ }
+
+ if (error != null) {
+
+ logger.error("Transpilation failed!");
+ if (shortError != null) {
+ logger.error(shortError);
+ }
+
+ fl.setCodeError(error);
+ logger.debug("Persisting error details...");
+
+ entryManager.merge(fl);
+ logger.warn("Check database for errors");
+ }
+ }
+ traces = makeSimpleMap(map);
+
+ }
+
+
+}
diff --git a/agama/engine/src/main/java/io/jans/agama/timer/TranspilationEvent.java b/agama/engine/src/main/java/io/jans/agama/timer/TranspilationEvent.java
new file mode 100644
index 00000000000..793105bb77d
--- /dev/null
+++ b/agama/engine/src/main/java/io/jans/agama/timer/TranspilationEvent.java
@@ -0,0 +1,3 @@
+package io.jans.agama.timer;
+
+public class TranspilationEvent { }
diff --git a/agama/engine/src/main/resources/META-INF/beans.xml b/agama/engine/src/main/resources/META-INF/beans.xml
new file mode 100644
index 00000000000..d87ce4e5eac
--- /dev/null
+++ b/agama/engine/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/agama/misc/bridge.py b/agama/misc/bridge.py
new file mode 100644
index 00000000000..63dc73fbf79
--- /dev/null
+++ b/agama/misc/bridge.py
@@ -0,0 +1,173 @@
+# Janssen Project software is available under the Apache 2.0 License (2004). See http://www.apache.org/licenses/ for full text.
+# Copyright (c) 2020, Janssen Project
+#
+from io.jans.agama import NativeJansFlowBridge
+from io.jans.agama.model import Config, EngineConfig
+from io.jans.as.server.service import AuthenticationService, SessionIdService
+from io.jans.jsf2.service import FacesService
+from io.jans.jsf2.message import FacesMessages
+from io.jans.model.custom.script.type.auth import PersonAuthenticationType
+from io.jans.orm import PersistenceEntryManager
+from io.jans.service.cdi.util import CdiUtil
+from io.jans.util import StringHelper
+
+from jakarta.faces.application import FacesMessage
+
+import java
+import sys
+
+class PersonAuthentication(PersonAuthenticationType):
+ def __init__(self, currentTimeMillis):
+ self.currentTimeMillis = currentTimeMillis
+
+ def init(self, customScript, configurationAttributes):
+ print "Agama. Initialization"
+ prop = "cust_param_name"
+ self.cust_param_name = self.configProperty(configurationAttributes, prop)
+
+ if self.cust_param_name == None:
+ print "Agama. Custom parameter name not referenced via property '%s'" % prop
+ return False
+
+ print "Agama. Request param '%s' will be used to pass flow inputs" % self.cust_param_name
+ print "Agama. Initialized successfully"
+ return True
+
+ def destroy(self, configurationAttributes):
+ print "Agama. Destroy"
+ print "Agama. Destroyed successfully"
+ return True
+
+ def getAuthenticationMethodClaims(self, requestParameters):
+ return None
+
+ def getApiVersion(self):
+ return 11
+
+ def isValidAuthenticationMethod(self, usageType, configurationAttributes):
+ return True
+
+ def getAlternativeAuthenticationMethod(self, usageType, configurationAttributes):
+ return None
+
+ def authenticate(self, configurationAttributes, requestParameters, step):
+
+ if step == 1:
+ print "Agama. Authenticate for step 1"
+
+ try:
+ bridge = CdiUtil.bean(NativeJansFlowBridge)
+ result = bridge.close()
+
+ if result == None or not result.isSuccess():
+ print "Agama. Flow DID NOT finished successfully"
+ return False
+ else:
+ print "Agama. Flow finished successfully"
+ data = result.getData()
+ userId = data.get("userId") if data != None else None
+
+ if userId == None:
+ print "Agama. No userId provided in flow result."
+ self.setMessageError(FacesMessage.SEVERITY_ERROR, "Unable to determine identity of user")
+ return False
+
+ authenticated = CdiUtil.bean(AuthenticationService).authenticate(userId)
+
+ if not authenticated:
+ print "Agama. Unable to authenticate %s" % userId
+ return False
+ except:
+ print "Agama. Exception: ", sys.exc_info()[1]
+ return False
+
+ return True
+
+
+ def prepareForStep(self, configurationAttributes, requestParameters, step):
+ if step == 1:
+ print "Agama. Prepare for Step 1"
+
+ session = CdiUtil.bean(SessionIdService).getSessionId()
+ if session == None:
+ print "Agama. Failed to retrieve session_id"
+ return False
+
+ param = session.getSessionAttributes().get(self.cust_param_name)
+ if param == None:
+ print "Agama. Request param '%s' is missing or has no value" % self.cust_param_name
+ return False
+
+ (qn, ins) = self.extractParams(param)
+ if qn == None:
+ print "Agama. Param '%s' is missing the name of the flow to be launched" % self.cust_param_name
+ return False
+
+ try:
+ bridge = CdiUtil.bean(NativeJansFlowBridge)
+ running = bridge.prepareFlow(session.getId(), qn, ins)
+
+ if running == None:
+ print "Agama. Flow '%s' does not exist!" % qn
+ return False
+ elif running:
+ print "Agama. A flow is already in course"
+
+ print "Agama. Redirecting to start/resume agama flow '%s'..." % qn
+
+ CdiUtil.bean(FacesService).redirectToExternalURL(bridge.getTriggerUrl())
+ except:
+ print "Agama. An error occurred when launching flow '%s'. Check jans-auth logs" % qn
+ print "Agama. Exception: ", sys.exc_info()[1]
+ return False
+ #except java.lang.Throwable, ex:
+ # ex.printStackTrace()
+ # return False
+ return True
+
+ def getExtraParametersForStep(self, configurationAttributes, step):
+ return None
+
+ def getCountAuthenticationSteps(self, configurationAttributes):
+ return 1
+
+ def getPageForStep(self, configurationAttributes, step):
+ return "/" + CdiUtil.bean(NativeJansFlowBridge).scriptPageUrl()
+
+ def getNextStep(self, configurationAttributes, requestParameters, step):
+ return -1
+
+ def getLogoutExternalUrl(self, configurationAttributes, requestParameters):
+ return None
+
+ def logout(self, configurationAttributes, requestParameters):
+ return True
+
+# Misc routines
+
+ def configProperty(self, configProperties, name):
+ prop = configProperties.get(name)
+ return None if prop == None else prop.getValue2()
+
+ def setMessageError(self, severity, msg):
+ facesMessages = CdiUtil.bean(FacesMessages)
+ facesMessages.setKeepMessages()
+ facesMessages.clear()
+ facesMessages.add(severity, msg)
+
+ def extractParams(self, param):
+
+ # param must be of the form QN-INPUT where QN is the qualified name of the flow to launch
+ # INPUT is a JSON object that contains the arguments to use for the flow call.
+ # The keys of this object should match the already defined flow inputs. Ideally, and
+ # depending on the actual flow implementation, some keys may not even be required
+ # QN and INPUTS are separated by a hyphen
+ # INPUT must be properly URL-encoded when HTTP GET is used
+
+ i = param.find("-")
+ if i == 0:
+ return (None, None)
+ elif i == -1:
+ return (param, None)
+ else:
+ return (param[:i], param[i:])
diff --git a/agama/misc/crash.ftl b/agama/misc/crash.ftl
new file mode 100644
index 00000000000..92c3fc9fdb5
--- /dev/null
+++ b/agama/misc/crash.ftl
@@ -0,0 +1,13 @@
+<#ftl output_format="HTML">
+
+
+
+
+An unexpected error ocurred:
+
+${message!""}
+
+
Try again later
+
+
+
diff --git a/agama/misc/finished.ftl b/agama/misc/finished.ftl
new file mode 100644
index 00000000000..1d7e8c6c299
--- /dev/null
+++ b/agama/misc/finished.ftl
@@ -0,0 +1,45 @@
+<#ftl output_format="HTML">
+
+
+
+ <#if success>Redirecting you...<#else>Error :(#if>
+
+
+ <#if !success>
+
+ #if>
+
+
+
+<#if success>
+
+Almost done!
+
+Redirecting you...
+
+
+
+
+
+<#else>
+
+Authentication failed
+
+${error!""}
+
+
Try again later
+
+#if>
+
+
+
diff --git a/agama/misc/mismatch.ftl b/agama/misc/mismatch.ftl
new file mode 100644
index 00000000000..0b1089f7e62
--- /dev/null
+++ b/agama/misc/mismatch.ftl
@@ -0,0 +1,16 @@
+<#ftl output_format="HTML">
+
+
+
+
+Want to continue with your authentication process?
+
+<#if message??>If so, click here to return where you left off.#if>
+
To start all over again, click the button below.
+
+
+
+
+
\ No newline at end of file
diff --git a/agama/misc/timeout.ftl b/agama/misc/timeout.ftl
new file mode 100644
index 00000000000..356c8b76dae
--- /dev/null
+++ b/agama/misc/timeout.ftl
@@ -0,0 +1,13 @@
+<#ftl output_format="HTML">
+
+
+
+
+This took you more than expected!
+
+${message}
+
+
Try again later
+
+
+
diff --git a/agama/model/pom.xml b/agama/model/pom.xml
new file mode 100644
index 00000000000..a02d91d26aa
--- /dev/null
+++ b/agama/model/pom.xml
@@ -0,0 +1,35 @@
+
+
+
+ 4.0.0
+
+ agama-model
+ jar
+
+
+ io.jans
+ agama
+ 1.0.0-SNAPSHOT
+
+
+
+
+ io.jans
+ jans-orm-model
+ provided
+
+
+ io.jans
+ jans-core-util
+ provided
+
+
+ org.jboss.spec.javax.ws.rs
+ jboss-jaxrs-api_3.0_spec
+ provided
+
+
+
+
diff --git a/agama/model/src/main/java/io/jans/agama/model/Config.java b/agama/model/src/main/java/io/jans/agama/model/Config.java
new file mode 100644
index 00000000000..9baa4cfaf10
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/Config.java
@@ -0,0 +1,47 @@
+package io.jans.agama.model;
+
+import io.jans.orm.annotation.AttributeName;
+import io.jans.orm.annotation.DataEntry;
+import io.jans.orm.annotation.JsonObject;
+import io.jans.orm.annotation.ObjectClass;
+import io.jans.orm.model.base.Entry;
+
+@DataEntry
+@ObjectClass(value = "agmConfig")
+public class Config extends Entry {
+
+ @AttributeName
+ private String ou;
+
+ @AttributeName(name = "jansScr")
+ private String utilScript;
+
+ @JsonObject
+ @AttributeName(name = "jansConfApp")
+ private EngineConfig engineConf;
+
+ public String getOu() {
+ return ou;
+ }
+
+ public void setOu(String ou) {
+ this.ou = ou;
+ }
+
+ public String getUtilScript() {
+ return utilScript;
+ }
+
+ public void setUtilScript(String utilScript) {
+ this.utilScript = utilScript;
+ }
+
+ public EngineConfig getEngineConf() {
+ return engineConf;
+ }
+
+ public void setEngineConf(EngineConfig engineConf) {
+ this.engineConf = engineConf;
+ }
+
+}
diff --git a/agama/model/src/main/java/io/jans/agama/model/EngineConfig.java b/agama/model/src/main/java/io/jans/agama/model/EngineConfig.java
new file mode 100644
index 00000000000..d1e965337f5
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/EngineConfig.java
@@ -0,0 +1,161 @@
+package io.jans.agama.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import io.jans.agama.model.serialize.Type;
+import io.jans.util.Pair;
+
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class EngineConfig {
+
+ private String rootDir;
+ private String templatesPath = "/ftl";
+ private String scriptsPath = "/scripts";
+
+ private Type serializerType = Type.KRYO;
+
+ //Time used to determine if flow timeout has occurred in Agama. A negative
+ //value means no timeout will ever occur
+ private int interruptionTime;
+
+ private int maxItemsLoggedInCollections = 3;
+
+ //transpiled code hash verification. Boolean preferred over boolean because it helps to keep the property "hidden"
+ private Boolean disableTCHV;
+
+ private String pageMismatchErrorPage = "mismatch.ftl";
+ private String interruptionErrorPage = "timeout.ftl";
+ private String crashErrorPage = "crash.ftl";
+ private String finishedFlowPage = "finished.ftl";
+
+ //relative to https://.../jans-auth
+ private String bridgeScriptPage = "agama.xhtml";
+
+ private Map defaultResponseHeaders = Stream.of(
+ new Pair<>(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML)
+ , new Pair<>(HttpHeaders.EXPIRES, "0")
+ //, new Pair<>(HttpHeaders.CACHE_CONTROL, "no-cache")
+ //, new Pair<>(HttpHeaders.CACHE_CONTROL, "no-store")
+ ).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
+
+ public String getJsonErrorPage(String page) {
+ return "json_"+ page;
+ }
+
+ @JsonIgnore
+ public String getJsonFinishedFlowPage() {
+ return "json_"+ finishedFlowPage;
+ }
+
+ public String getRootDir() {
+ return rootDir;
+ }
+
+ public void setRootDir(String rootDir) {
+ this.rootDir = rootDir;
+ }
+
+ public String getTemplatesPath() {
+ return templatesPath;
+ }
+
+ public void setTemplatesPath(String templatesPath) {
+ this.templatesPath = templatesPath;
+ }
+
+ public String getScriptsPath() {
+ return scriptsPath;
+ }
+
+ public void setScriptsPath(String scriptsPath) {
+ this.scriptsPath = scriptsPath;
+ }
+
+ public Type getSerializerType() {
+ return serializerType;
+ }
+
+ public void setSerializerType(Type serializerType) {
+ this.serializerType = serializerType;
+ }
+
+ public int getInterruptionTime() {
+ return interruptionTime;
+ }
+
+ public void setInterruptionTime(int interruptionTime) {
+ this.interruptionTime = interruptionTime;
+ }
+
+ public String getInterruptionErrorPage() {
+ return interruptionErrorPage;
+ }
+
+ public void setInterruptionErrorPage(String interruptionErrorPage) {
+ this.interruptionErrorPage = interruptionErrorPage;
+ }
+
+ public int getMaxItemsLoggedInCollections() {
+ return maxItemsLoggedInCollections;
+ }
+
+ public void setMaxItemsLoggedInCollections(int maxItemsLoggedInCollections) {
+ this.maxItemsLoggedInCollections = maxItemsLoggedInCollections;
+ }
+
+ public Boolean getDisableTCHV() {
+ return disableTCHV;
+ }
+
+ public void setDisableTCHV(Boolean disableTCHV) {
+ this.disableTCHV = disableTCHV;
+ }
+
+ public String getCrashErrorPage() {
+ return crashErrorPage;
+ }
+
+ public void setCrashErrorPage(String crashErrorPage) {
+ this.crashErrorPage = crashErrorPage;
+ }
+
+ public String getPageMismatchErrorPage() {
+ return pageMismatchErrorPage;
+ }
+
+ public void setPageMismatchErrorPage(String pageMismatchErrorPage) {
+ this.pageMismatchErrorPage = pageMismatchErrorPage;
+ }
+
+ public String getFinishedFlowPage() {
+ return finishedFlowPage;
+ }
+
+ public void setFinishedFlowPage(String finishedFlowPage) {
+ this.finishedFlowPage = finishedFlowPage;
+ }
+
+ public String getBridgeScriptPage() {
+ return bridgeScriptPage;
+ }
+
+ public void setBridgeScriptPage(String bridgeScriptPage) {
+ this.bridgeScriptPage = bridgeScriptPage;
+ }
+
+ public Map getDefaultResponseHeaders() {
+ return defaultResponseHeaders;
+ }
+
+ public void setDefaultResponseHeaders(Map defaultResponseHeaders) {
+ this.defaultResponseHeaders = defaultResponseHeaders;
+ }
+
+}
diff --git a/agama/model/src/main/java/io/jans/agama/model/Flow.java b/agama/model/src/main/java/io/jans/agama/model/Flow.java
new file mode 100644
index 00000000000..4d2b382c7e6
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/Flow.java
@@ -0,0 +1,66 @@
+package io.jans.agama.model;
+
+import io.jans.orm.annotation.AttributeName;
+import io.jans.orm.annotation.DataEntry;
+import io.jans.orm.annotation.JsonObject;
+import io.jans.orm.annotation.ObjectClass;
+
+@DataEntry
+@ObjectClass(value = Flow.ATTR_NAMES.OBJECT_CLASS)
+public class Flow extends ProtoFlow {
+
+ //An enum cannot be used because elements of annotations (like AttributeName) have to be constants
+ public class ATTR_NAMES {
+ public static final String OBJECT_CLASS = "agmFlow";
+ public static final String QNAME = "agFlowQname";
+ public static final String META = "agFlowMeta";
+ public static final String TRANSPILED = "agFlowTrans";
+ public static final String HASH = "jansCustomMessage";
+ }
+
+ @JsonObject
+ @AttributeName(name = ATTR_NAMES.META)
+ private FlowMetadata metadata;
+
+ @AttributeName(name = "jansScr")
+ private String source;
+
+ @AttributeName(name = ATTR_NAMES.TRANSPILED)
+ private String transpiled;
+
+ @AttributeName(name = "jansScrError")
+ private String codeError;
+
+ public FlowMetadata getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(FlowMetadata flowMeta) {
+ this.metadata = flowMeta;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getTranspiled() {
+ return transpiled;
+ }
+
+ public void setTranspiled(String transpiled) {
+ this.transpiled = transpiled;
+ }
+
+ public String getCodeError() {
+ return codeError;
+ }
+
+ public void setCodeError(String codeError) {
+ this.codeError = codeError;
+ }
+
+}
diff --git a/agama/model/src/main/java/io/jans/agama/model/FlowMetadata.java b/agama/model/src/main/java/io/jans/agama/model/FlowMetadata.java
new file mode 100644
index 00000000000..0ae5d26bc85
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/FlowMetadata.java
@@ -0,0 +1,76 @@
+package io.jans.agama.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.util.List;
+import java.util.Map;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class FlowMetadata {
+
+ private String funcName;
+ private List inputs;
+ private String displayName;
+ private String author;
+ private long timestamp;
+
+ private String description;
+ private Map customProps;
+
+ public String getFuncName() {
+ return funcName;
+ }
+
+ public void setFuncName(String funcName) {
+ this.funcName = funcName;
+ }
+
+ public List getInputs() {
+ return inputs;
+ }
+
+ public void setInputs(List inputs) {
+ this.inputs = inputs;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map getCustomProps() {
+ return customProps;
+ }
+
+ public void setCustomProps(Map customProps) {
+ this.customProps = customProps;
+ }
+
+}
diff --git a/agama/model/src/main/java/io/jans/agama/model/ProtoFlow.java b/agama/model/src/main/java/io/jans/agama/model/ProtoFlow.java
new file mode 100644
index 00000000000..79a2c2cc801
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/ProtoFlow.java
@@ -0,0 +1,61 @@
+package io.jans.agama.model;
+
+/**
+ * This class is used as a vehicle to overcome jans-orm limitation related to data
+ * destruction when an update is made on a partially retrieved entity. It also helps
+ * to make "lighter" retrievals of Flows
+ */
+import io.jans.orm.annotation.AttributeName;
+import io.jans.orm.annotation.DataEntry;
+import io.jans.orm.annotation.ObjectClass;
+import io.jans.orm.model.base.Entry;
+
+@DataEntry
+@ObjectClass(value = Flow.ATTR_NAMES.OBJECT_CLASS)
+public class ProtoFlow extends Entry {
+
+ @AttributeName(name = Flow.ATTR_NAMES.QNAME)
+ private String QName;
+
+ @AttributeName(name = Flow.ATTR_NAMES.HASH)
+ private String transHash;
+
+ @AttributeName(name = "jansRevision")
+ private int revision;
+
+ @AttributeName(name = "jansEnabled")
+ private boolean enabled;
+
+ public String getQName() {
+ return QName;
+ }
+
+ public void setQName(String QName) {
+ this.QName = QName;
+ }
+
+ public String getTransHash() {
+ return transHash;
+ }
+
+ public void setTransHash(String transHash) {
+ this.transHash = transHash;
+ }
+
+ public int getRevision() {
+ return revision;
+ }
+
+ public void setRevision(int revision) {
+ this.revision = revision;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+}
diff --git a/agama/model/src/main/java/io/jans/agama/model/serialize/Type.java b/agama/model/src/main/java/io/jans/agama/model/serialize/Type.java
new file mode 100644
index 00000000000..f67c07bcf0f
--- /dev/null
+++ b/agama/model/src/main/java/io/jans/agama/model/serialize/Type.java
@@ -0,0 +1,4 @@
+package io.jans.agama.model.serialize;
+
+public enum Type { KRYO, FST }
+
diff --git a/agama/pom.xml b/agama/pom.xml
new file mode 100644
index 00000000000..f6efaa83687
--- /dev/null
+++ b/agama/pom.xml
@@ -0,0 +1,60 @@
+
+
+
+ 4.0.0
+ io.jans
+ agama
+ pom
+ 1.0.0-SNAPSHOT
+ agama parent
+
+
+ ${maven.min-version}
+
+
+
+ 11
+ 11
+ UTF-8
+ 3.6.3
+ 1.0.0-SNAPSHOT
+
+
+
+
+ jans
+ Janssen project repository
+ https://maven.jans.io/maven
+
+
+
+
+ model
+ transpiler
+ engine
+
+
+
+
+
+ io.jans
+ jans-bom
+ ${jans.version}
+ import
+ pom
+
+
+
+
+ org.jboss.spec.javax.ws.rs
+ jboss-jaxrs-api_3.0_spec
+ 1.0.1.Final
+ provided
+
+
+
+
+
diff --git a/agama/transpiler/pom.xml b/agama/transpiler/pom.xml
new file mode 100644
index 00000000000..529908bc0dd
--- /dev/null
+++ b/agama/transpiler/pom.xml
@@ -0,0 +1,67 @@
+
+
+
+ 4.0.0
+
+ agama-transpiler
+ jar
+
+
+ io.jans
+ agama
+ 1.0.0-SNAPSHOT
+
+
+
+
+ net.sf.saxon
+ Saxon-HE
+ 10.5
+
+
+ com.yuvalshavit
+ antlr-denter
+ 1.1
+
+
+ org.antlr
+ antlr4-runtime
+ 4.9.2
+
+
+
+
+ org.freemarker
+ freemarker
+ 2.3.31
+
+
+
+
+ org.apache.logging.log4j
+ log4j-slf4j-impl
+ provided
+
+
+ org.apache.logging.log4j
+ log4j-api
+ provided
+
+
+ org.apache.logging.log4j
+ log4j-core
+ provided
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ provided
+
+
+
+
+
diff --git a/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseListener.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseListener.java
new file mode 100644
index 00000000000..40c15266604
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseListener.java
@@ -0,0 +1,531 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+
+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 AuthnFlowListener},
+ * which can be extended to create a listener which only needs to handle a subset
+ * of the available methods.
+ */
+public class AuthnFlowBaseListener implements AuthnFlowListener {
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFlow(AuthnFlowParser.FlowContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFlow(AuthnFlowParser.FlowContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterHeader(AuthnFlowParser.HeaderContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitHeader(AuthnFlowParser.HeaderContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterQname(AuthnFlowParser.QnameContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitQname(AuthnFlowParser.QnameContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterBase(AuthnFlowParser.BaseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitBase(AuthnFlowParser.BaseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterInputs(AuthnFlowParser.InputsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitInputs(AuthnFlowParser.InputsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterShort_var(AuthnFlowParser.Short_varContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitShort_var(AuthnFlowParser.Short_varContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatement(AuthnFlowParser.StatementContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatement(AuthnFlowParser.StatementContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterPreassign(AuthnFlowParser.PreassignContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitPreassign(AuthnFlowParser.PreassignContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterVariable(AuthnFlowParser.VariableContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitVariable(AuthnFlowParser.VariableContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFlow_call(AuthnFlowParser.Flow_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFlow_call(AuthnFlowParser.Flow_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterOverrides(AuthnFlowParser.OverridesContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitOverrides(AuthnFlowParser.OverridesContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAction_call(AuthnFlowParser.Action_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAction_call(AuthnFlowParser.Action_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterRrf_call(AuthnFlowParser.Rrf_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitRrf_call(AuthnFlowParser.Rrf_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterLog(AuthnFlowParser.LogContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitLog(AuthnFlowParser.LogContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatic_call(AuthnFlowParser.Static_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatic_call(AuthnFlowParser.Static_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterOo_call(AuthnFlowParser.Oo_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitOo_call(AuthnFlowParser.Oo_callContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterArgument(AuthnFlowParser.ArgumentContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitArgument(AuthnFlowParser.ArgumentContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterSimple_expr(AuthnFlowParser.Simple_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitSimple_expr(AuthnFlowParser.Simple_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterLiteral(AuthnFlowParser.LiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitLiteral(AuthnFlowParser.LiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterExpression(AuthnFlowParser.ExpressionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitExpression(AuthnFlowParser.ExpressionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterArray_expr(AuthnFlowParser.Array_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitArray_expr(AuthnFlowParser.Array_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterObject_expr(AuthnFlowParser.Object_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitObject_expr(AuthnFlowParser.Object_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterAssignment(AuthnFlowParser.AssignmentContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitAssignment(AuthnFlowParser.AssignmentContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterKeypair(AuthnFlowParser.KeypairContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitKeypair(AuthnFlowParser.KeypairContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterRfac(AuthnFlowParser.RfacContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitRfac(AuthnFlowParser.RfacContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterFinish(AuthnFlowParser.FinishContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitFinish(AuthnFlowParser.FinishContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterChoice(AuthnFlowParser.ChoiceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitChoice(AuthnFlowParser.ChoiceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterOption(AuthnFlowParser.OptionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitOption(AuthnFlowParser.OptionContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterIfelse(AuthnFlowParser.IfelseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitIfelse(AuthnFlowParser.IfelseContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterCaseof(AuthnFlowParser.CaseofContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitCaseof(AuthnFlowParser.CaseofContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterElseblock(AuthnFlowParser.ElseblockContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitElseblock(AuthnFlowParser.ElseblockContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterLoop(AuthnFlowParser.LoopContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitLoop(AuthnFlowParser.LoopContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterLoopy(AuthnFlowParser.LoopyContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitLoopy(AuthnFlowParser.LoopyContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatusr_block(AuthnFlowParser.Statusr_blockContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatusr_block(AuthnFlowParser.Statusr_blockContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterStatusr_until(AuthnFlowParser.Statusr_untilContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitStatusr_until(AuthnFlowParser.Statusr_untilContext 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/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseVisitor.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseVisitor.java
new file mode 100644
index 00000000000..2ef2f2627d5
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowBaseVisitor.java
@@ -0,0 +1,301 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+/**
+ * This class provides an empty implementation of {@link AuthnFlowVisitor},
+ * 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 AuthnFlowBaseVisitor extends AbstractParseTreeVisitor implements AuthnFlowVisitor {
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFlow(AuthnFlowParser.FlowContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitHeader(AuthnFlowParser.HeaderContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitQname(AuthnFlowParser.QnameContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitBase(AuthnFlowParser.BaseContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitInputs(AuthnFlowParser.InputsContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitShort_var(AuthnFlowParser.Short_varContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatement(AuthnFlowParser.StatementContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitPreassign(AuthnFlowParser.PreassignContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitVariable(AuthnFlowParser.VariableContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFlow_call(AuthnFlowParser.Flow_callContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitOverrides(AuthnFlowParser.OverridesContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAction_call(AuthnFlowParser.Action_callContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitRrf_call(AuthnFlowParser.Rrf_callContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitLog(AuthnFlowParser.LogContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatic_call(AuthnFlowParser.Static_callContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitOo_call(AuthnFlowParser.Oo_callContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitArgument(AuthnFlowParser.ArgumentContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitSimple_expr(AuthnFlowParser.Simple_exprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitLiteral(AuthnFlowParser.LiteralContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitExpression(AuthnFlowParser.ExpressionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitArray_expr(AuthnFlowParser.Array_exprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitObject_expr(AuthnFlowParser.Object_exprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitAssignment(AuthnFlowParser.AssignmentContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitKeypair(AuthnFlowParser.KeypairContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitRfac(AuthnFlowParser.RfacContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitFinish(AuthnFlowParser.FinishContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitChoice(AuthnFlowParser.ChoiceContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitOption(AuthnFlowParser.OptionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitIfelse(AuthnFlowParser.IfelseContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitCaseof(AuthnFlowParser.CaseofContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitElseblock(AuthnFlowParser.ElseblockContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitLoop(AuthnFlowParser.LoopContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitLoopy(AuthnFlowParser.LoopyContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatusr_block(AuthnFlowParser.Statusr_blockContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitStatusr_until(AuthnFlowParser.Statusr_untilContext ctx) { return visitChildren(ctx); }
+}
\ No newline at end of file
diff --git a/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowLexer.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowLexer.java
new file mode 100644
index 00000000000..acfb9f2354a
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowLexer.java
@@ -0,0 +1,320 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+
+ import com.yuvalshavit.antlr4.DenterHelper;
+
+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 AuthnFlowLexer 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
+ T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, NL=9,
+ COMMENT=10, FLOWSTART=11, BASE=12, FLOWINPUTS=13, LOG=14, FLOWCALL=15,
+ ACTIONCALL=16, RRFCALL=17, STATUS_REQ=18, ALLOW=19, REPLY=20, UNTIL=21,
+ OVERRIDE=22, WHEN=23, OTHERWISE=24, REPEAT=25, ITERATE=26, MATCH=27, QUIT=28,
+ FINISH=29, RFAC=30, IS=31, NOT=32, AND=33, OR=34, SECS=35, TO=36, MAXTIMES=37,
+ USE=38, EQ=39, MINUS=40, NUL=41, BOOL=42, STRING=43, UINT=44, SINT=45,
+ DECIMAL=46, ALPHANUM=47, QNAME=48, EVALNUM=49, DOTEXPR=50, DOTIDXEXPR=51,
+ SPCOMMA=52, WS=53;
+ public static String[] channelNames = {
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
+ };
+
+ public static String[] modeNames = {
+ "DEFAULT_MODE"
+ };
+
+ private static String[] makeRuleNames() {
+ return new String[] {
+ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "NL",
+ "DIGIT", "CH", "ALNUM", "SPACES", "COMMA", "COMMENT", "FLOWSTART", "BASE",
+ "FLOWINPUTS", "LOG", "FLOWCALL", "ACTIONCALL", "RRFCALL", "STATUS_REQ",
+ "ALLOW", "REPLY", "UNTIL", "OVERRIDE", "WHEN", "OTHERWISE", "REPEAT",
+ "ITERATE", "MATCH", "QUIT", "FINISH", "RFAC", "IS", "NOT", "AND", "OR",
+ "SECS", "TO", "MAXTIMES", "USE", "EQ", "MINUS", "NUL", "BOOL", "STRING",
+ "UINT", "SINT", "DECIMAL", "ALPHANUM", "QNAME", "EVALNUM", "DOTEXPR",
+ "DOTIDXEXPR", "SPCOMMA", "WS"
+ };
+ }
+ public static final String[] ruleNames = makeRuleNames();
+
+ private static String[] makeLiteralNames() {
+ return new String[] {
+ null, "'|'", "'$'", "'#'", "'['", "']'", "'{'", "'}'", "':'", null, null,
+ "'Flow'", "'Basepath'", "'Inputs'", "'Log'", "'Trigger'", "'Call'", "'RRF'",
+ "'Status requests'", "'Allow for'", "'Reply'", "'Until'", "'Override templates'",
+ "'When'", "'Otherwise'", "'Repeat'", "'Iterate over'", "'Match'", "'Quit'",
+ "'Finish'", "'RFAC'", "'is'", "'not'", "'and'", "'or'", "'seconds'",
+ "'to'", "'times max'", "'using'", "'='", "'-'", "'null'"
+ };
+ }
+ private static final String[] _LITERAL_NAMES = makeLiteralNames();
+ private static String[] makeSymbolicNames() {
+ return new String[] {
+ null, null, null, null, null, null, null, null, null, "NL", "COMMENT",
+ "FLOWSTART", "BASE", "FLOWINPUTS", "LOG", "FLOWCALL", "ACTIONCALL", "RRFCALL",
+ "STATUS_REQ", "ALLOW", "REPLY", "UNTIL", "OVERRIDE", "WHEN", "OTHERWISE",
+ "REPEAT", "ITERATE", "MATCH", "QUIT", "FINISH", "RFAC", "IS", "NOT",
+ "AND", "OR", "SECS", "TO", "MAXTIMES", "USE", "EQ", "MINUS", "NUL", "BOOL",
+ "STRING", "UINT", "SINT", "DECIMAL", "ALPHANUM", "QNAME", "EVALNUM",
+ "DOTEXPR", "DOTIDXEXPR", "SPCOMMA", "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;
+ }
+
+
+ private final DenterHelper denter = DenterHelper.builder()
+ .nl(NL)
+ .indent(AuthnFlowParser.INDENT)
+ .dedent(AuthnFlowParser.DEDENT)
+ .pullToken(AuthnFlowLexer.super::nextToken);
+
+ @Override
+ public Token nextToken() {
+ return denter.nextToken();
+ }
+
+
+ public AuthnFlowLexer(CharStream input) {
+ super(input);
+ _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+ }
+
+ @Override
+ public String getGrammarFileName() { return "AuthnFlow.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\67\u01e7\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;\3\2\3\2\3"+
+ "\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3\n\5\n\u0089\n"+
+ "\n\3\n\3\n\7\n\u008d\n\n\f\n\16\n\u0090\13\n\3\13\3\13\3\f\3\f\3\r\3\r"+
+ "\3\r\3\r\7\r\u009a\n\r\f\r\16\r\u009d\13\r\3\16\6\16\u00a0\n\16\r\16\16"+
+ "\16\u00a1\3\17\3\17\3\20\3\20\3\20\3\20\7\20\u00aa\n\20\f\20\16\20\u00ad"+
+ "\13\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\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\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\26\3\26\3\26\3\26\3\26\3\27"+
+ "\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30"+
+ "\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\32\3\32\3\32\3\32\3\32\3\32\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\34\3\34\3\34\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\36\3\36\3\36\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 \3 \3 "+
+ "\3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3"+
+ "#\3#\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3%\3%\3%\3&\3&\3&\3&\3\'\3\'\3\'\3"+
+ "\'\3(\3(\3(\3)\3)\3)\3)\3)\3)\3)\3)\3*\3*\3*\3+\3+\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\60\3\60\3\60\3\60\3\60\5\60\u0189\n\60\3\61\3\61\7\61\u018d\n\61\f"+
+ "\61\16\61\u0190\13\61\3\61\3\61\3\62\6\62\u0195\n\62\r\62\16\62\u0196"+
+ "\3\63\3\63\3\63\3\64\3\64\5\64\u019e\n\64\3\64\3\64\3\64\3\65\3\65\3\66"+
+ "\3\66\3\66\7\66\u01a8\n\66\f\66\16\66\u01ab\13\66\3\67\3\67\3\67\5\67"+
+ "\u01b0\n\67\3\67\5\67\u01b3\n\67\38\38\78\u01b7\n8\f8\168\u01ba\138\3"+
+ "9\39\39\59\u01bf\n9\39\39\59\u01c3\n9\39\59\u01c6\n9\39\39\79\u01ca\n"+
+ "9\f9\169\u01cd\139\69\u01cf\n9\r9\169\u01d0\3:\5:\u01d4\n:\3:\7:\u01d7"+
+ "\n:\f:\16:\u01da\13:\3:\3:\5:\u01de\n:\3:\7:\u01e1\n:\f:\16:\u01e4\13"+
+ ":\3;\3;\2\2<\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\2\27\2\31\2\33"+
+ "\2\35\2\37\f!\r#\16%\17\'\20)\21+\22-\23/\24\61\25\63\26\65\27\67\309"+
+ "\31;\32=\33?\34A\35C\36E\37G I!K\"M#O$Q%S&U\'W(Y)[*]+_,a-c.e/g\60i\61"+
+ "k\62m\63o\64q\65s\66u\67\3\2\7\4\2\13\13\"\"\3\2\62;\4\2C\\c|\4\2\f\f"+
+ "\17\17\7\2\13\13\"#%\u0080\u0082\u008e\u00a2\1\2\u01f9\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\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\2A\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\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\3w\3\2\2\2\5y\3\2\2\2\7{\3\2\2\2\t}"+
+ "\3\2\2\2\13\177\3\2\2\2\r\u0081\3\2\2\2\17\u0083\3\2\2\2\21\u0085\3\2"+
+ "\2\2\23\u0088\3\2\2\2\25\u0091\3\2\2\2\27\u0093\3\2\2\2\31\u0095\3\2\2"+
+ "\2\33\u009f\3\2\2\2\35\u00a3\3\2\2\2\37\u00a5\3\2\2\2!\u00b0\3\2\2\2#"+
+ "\u00b5\3\2\2\2%\u00be\3\2\2\2\'\u00c5\3\2\2\2)\u00c9\3\2\2\2+\u00d1\3"+
+ "\2\2\2-\u00d6\3\2\2\2/\u00da\3\2\2\2\61\u00ea\3\2\2\2\63\u00f4\3\2\2\2"+
+ "\65\u00fa\3\2\2\2\67\u0100\3\2\2\29\u0113\3\2\2\2;\u0118\3\2\2\2=\u0122"+
+ "\3\2\2\2?\u0129\3\2\2\2A\u0136\3\2\2\2C\u013c\3\2\2\2E\u0141\3\2\2\2G"+
+ "\u0148\3\2\2\2I\u014d\3\2\2\2K\u0150\3\2\2\2M\u0154\3\2\2\2O\u0158\3\2"+
+ "\2\2Q\u015b\3\2\2\2S\u0163\3\2\2\2U\u0166\3\2\2\2W\u0170\3\2\2\2Y\u0176"+
+ "\3\2\2\2[\u0178\3\2\2\2]\u017a\3\2\2\2_\u0188\3\2\2\2a\u018a\3\2\2\2c"+
+ "\u0194\3\2\2\2e\u0198\3\2\2\2g\u019d\3\2\2\2i\u01a2\3\2\2\2k\u01a4\3\2"+
+ "\2\2m\u01ac\3\2\2\2o\u01b4\3\2\2\2q\u01bb\3\2\2\2s\u01d3\3\2\2\2u\u01e5"+
+ "\3\2\2\2wx\7~\2\2x\4\3\2\2\2yz\7&\2\2z\6\3\2\2\2{|\7%\2\2|\b\3\2\2\2}"+
+ "~\7]\2\2~\n\3\2\2\2\177\u0080\7_\2\2\u0080\f\3\2\2\2\u0081\u0082\7}\2"+
+ "\2\u0082\16\3\2\2\2\u0083\u0084\7\177\2\2\u0084\20\3\2\2\2\u0085\u0086"+
+ "\7<\2\2\u0086\22\3\2\2\2\u0087\u0089\7\17\2\2\u0088\u0087\3\2\2\2\u0088"+
+ "\u0089\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008e\7\f\2\2\u008b\u008d\t\2"+
+ "\2\2\u008c\u008b\3\2\2\2\u008d\u0090\3\2\2\2\u008e\u008c\3\2\2\2\u008e"+
+ "\u008f\3\2\2\2\u008f\24\3\2\2\2\u0090\u008e\3\2\2\2\u0091\u0092\t\3\2"+
+ "\2\u0092\26\3\2\2\2\u0093\u0094\t\4\2\2\u0094\30\3\2\2\2\u0095\u009b\5"+
+ "\27\f\2\u0096\u009a\7a\2\2\u0097\u009a\5\27\f\2\u0098\u009a\5\25\13\2"+
+ "\u0099\u0096\3\2\2\2\u0099\u0097\3\2\2\2\u0099\u0098\3\2\2\2\u009a\u009d"+
+ "\3\2\2\2\u009b\u0099\3\2\2\2\u009b\u009c\3\2\2\2\u009c\32\3\2\2\2\u009d"+
+ "\u009b\3\2\2\2\u009e\u00a0\t\2\2\2\u009f\u009e\3\2\2\2\u00a0\u00a1\3\2"+
+ "\2\2\u00a1\u009f\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\34\3\2\2\2\u00a3\u00a4"+
+ "\7.\2\2\u00a4\36\3\2\2\2\u00a5\u00a6\7\61\2\2\u00a6\u00a7\7\61\2\2\u00a7"+
+ "\u00ab\3\2\2\2\u00a8\u00aa\n\5\2\2\u00a9\u00a8\3\2\2\2\u00aa\u00ad\3\2"+
+ "\2\2\u00ab\u00a9\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ae\3\2\2\2\u00ad"+
+ "\u00ab\3\2\2\2\u00ae\u00af\b\20\2\2\u00af \3\2\2\2\u00b0\u00b1\7H\2\2"+
+ "\u00b1\u00b2\7n\2\2\u00b2\u00b3\7q\2\2\u00b3\u00b4\7y\2\2\u00b4\"\3\2"+
+ "\2\2\u00b5\u00b6\7D\2\2\u00b6\u00b7\7c\2\2\u00b7\u00b8\7u\2\2\u00b8\u00b9"+
+ "\7g\2\2\u00b9\u00ba\7r\2\2\u00ba\u00bb\7c\2\2\u00bb\u00bc\7v\2\2\u00bc"+
+ "\u00bd\7j\2\2\u00bd$\3\2\2\2\u00be\u00bf\7K\2\2\u00bf\u00c0\7p\2\2\u00c0"+
+ "\u00c1\7r\2\2\u00c1\u00c2\7w\2\2\u00c2\u00c3\7v\2\2\u00c3\u00c4\7u\2\2"+
+ "\u00c4&\3\2\2\2\u00c5\u00c6\7N\2\2\u00c6\u00c7\7q\2\2\u00c7\u00c8\7i\2"+
+ "\2\u00c8(\3\2\2\2\u00c9\u00ca\7V\2\2\u00ca\u00cb\7t\2\2\u00cb\u00cc\7"+
+ "k\2\2\u00cc\u00cd\7i\2\2\u00cd\u00ce\7i\2\2\u00ce\u00cf\7g\2\2\u00cf\u00d0"+
+ "\7t\2\2\u00d0*\3\2\2\2\u00d1\u00d2\7E\2\2\u00d2\u00d3\7c\2\2\u00d3\u00d4"+
+ "\7n\2\2\u00d4\u00d5\7n\2\2\u00d5,\3\2\2\2\u00d6\u00d7\7T\2\2\u00d7\u00d8"+
+ "\7T\2\2\u00d8\u00d9\7H\2\2\u00d9.\3\2\2\2\u00da\u00db\7U\2\2\u00db\u00dc"+
+ "\7v\2\2\u00dc\u00dd\7c\2\2\u00dd\u00de\7v\2\2\u00de\u00df\7w\2\2\u00df"+
+ "\u00e0\7u\2\2\u00e0\u00e1\7\"\2\2\u00e1\u00e2\7t\2\2\u00e2\u00e3\7g\2"+
+ "\2\u00e3\u00e4\7s\2\2\u00e4\u00e5\7w\2\2\u00e5\u00e6\7g\2\2\u00e6\u00e7"+
+ "\7u\2\2\u00e7\u00e8\7v\2\2\u00e8\u00e9\7u\2\2\u00e9\60\3\2\2\2\u00ea\u00eb"+
+ "\7C\2\2\u00eb\u00ec\7n\2\2\u00ec\u00ed\7n\2\2\u00ed\u00ee\7q\2\2\u00ee"+
+ "\u00ef\7y\2\2\u00ef\u00f0\7\"\2\2\u00f0\u00f1\7h\2\2\u00f1\u00f2\7q\2"+
+ "\2\u00f2\u00f3\7t\2\2\u00f3\62\3\2\2\2\u00f4\u00f5\7T\2\2\u00f5\u00f6"+
+ "\7g\2\2\u00f6\u00f7\7r\2\2\u00f7\u00f8\7n\2\2\u00f8\u00f9\7{\2\2\u00f9"+
+ "\64\3\2\2\2\u00fa\u00fb\7W\2\2\u00fb\u00fc\7p\2\2\u00fc\u00fd\7v\2\2\u00fd"+
+ "\u00fe\7k\2\2\u00fe\u00ff\7n\2\2\u00ff\66\3\2\2\2\u0100\u0101\7Q\2\2\u0101"+
+ "\u0102\7x\2\2\u0102\u0103\7g\2\2\u0103\u0104\7t\2\2\u0104\u0105\7t\2\2"+
+ "\u0105\u0106\7k\2\2\u0106\u0107\7f\2\2\u0107\u0108\7g\2\2\u0108\u0109"+
+ "\7\"\2\2\u0109\u010a\7v\2\2\u010a\u010b\7g\2\2\u010b\u010c\7o\2\2\u010c"+
+ "\u010d\7r\2\2\u010d\u010e\7n\2\2\u010e\u010f\7c\2\2\u010f\u0110\7v\2\2"+
+ "\u0110\u0111\7g\2\2\u0111\u0112\7u\2\2\u01128\3\2\2\2\u0113\u0114\7Y\2"+
+ "\2\u0114\u0115\7j\2\2\u0115\u0116\7g\2\2\u0116\u0117\7p\2\2\u0117:\3\2"+
+ "\2\2\u0118\u0119\7Q\2\2\u0119\u011a\7v\2\2\u011a\u011b\7j\2\2\u011b\u011c"+
+ "\7g\2\2\u011c\u011d\7t\2\2\u011d\u011e\7y\2\2\u011e\u011f\7k\2\2\u011f"+
+ "\u0120\7u\2\2\u0120\u0121\7g\2\2\u0121<\3\2\2\2\u0122\u0123\7T\2\2\u0123"+
+ "\u0124\7g\2\2\u0124\u0125\7r\2\2\u0125\u0126\7g\2\2\u0126\u0127\7c\2\2"+
+ "\u0127\u0128\7v\2\2\u0128>\3\2\2\2\u0129\u012a\7K\2\2\u012a\u012b\7v\2"+
+ "\2\u012b\u012c\7g\2\2\u012c\u012d\7t\2\2\u012d\u012e\7c\2\2\u012e\u012f"+
+ "\7v\2\2\u012f\u0130\7g\2\2\u0130\u0131\7\"\2\2\u0131\u0132\7q\2\2\u0132"+
+ "\u0133\7x\2\2\u0133\u0134\7g\2\2\u0134\u0135\7t\2\2\u0135@\3\2\2\2\u0136"+
+ "\u0137\7O\2\2\u0137\u0138\7c\2\2\u0138\u0139\7v\2\2\u0139\u013a\7e\2\2"+
+ "\u013a\u013b\7j\2\2\u013bB\3\2\2\2\u013c\u013d\7S\2\2\u013d\u013e\7w\2"+
+ "\2\u013e\u013f\7k\2\2\u013f\u0140\7v\2\2\u0140D\3\2\2\2\u0141\u0142\7"+
+ "H\2\2\u0142\u0143\7k\2\2\u0143\u0144\7p\2\2\u0144\u0145\7k\2\2\u0145\u0146"+
+ "\7u\2\2\u0146\u0147\7j\2\2\u0147F\3\2\2\2\u0148\u0149\7T\2\2\u0149\u014a"+
+ "\7H\2\2\u014a\u014b\7C\2\2\u014b\u014c\7E\2\2\u014cH\3\2\2\2\u014d\u014e"+
+ "\7k\2\2\u014e\u014f\7u\2\2\u014fJ\3\2\2\2\u0150\u0151\7p\2\2\u0151\u0152"+
+ "\7q\2\2\u0152\u0153\7v\2\2\u0153L\3\2\2\2\u0154\u0155\7c\2\2\u0155\u0156"+
+ "\7p\2\2\u0156\u0157\7f\2\2\u0157N\3\2\2\2\u0158\u0159\7q\2\2\u0159\u015a"+
+ "\7t\2\2\u015aP\3\2\2\2\u015b\u015c\7u\2\2\u015c\u015d\7g\2\2\u015d\u015e"+
+ "\7e\2\2\u015e\u015f\7q\2\2\u015f\u0160\7p\2\2\u0160\u0161\7f\2\2\u0161"+
+ "\u0162\7u\2\2\u0162R\3\2\2\2\u0163\u0164\7v\2\2\u0164\u0165\7q\2\2\u0165"+
+ "T\3\2\2\2\u0166\u0167\7v\2\2\u0167\u0168\7k\2\2\u0168\u0169\7o\2\2\u0169"+
+ "\u016a\7g\2\2\u016a\u016b\7u\2\2\u016b\u016c\7\"\2\2\u016c\u016d\7o\2"+
+ "\2\u016d\u016e\7c\2\2\u016e\u016f\7z\2\2\u016fV\3\2\2\2\u0170\u0171\7"+
+ "w\2\2\u0171\u0172\7u\2\2\u0172\u0173\7k\2\2\u0173\u0174\7p\2\2\u0174\u0175"+
+ "\7i\2\2\u0175X\3\2\2\2\u0176\u0177\7?\2\2\u0177Z\3\2\2\2\u0178\u0179\7"+
+ "/\2\2\u0179\\\3\2\2\2\u017a\u017b\7p\2\2\u017b\u017c\7w\2\2\u017c\u017d"+
+ "\7n\2\2\u017d\u017e\7n\2\2\u017e^\3\2\2\2\u017f\u0180\7h\2\2\u0180\u0181"+
+ "\7c\2\2\u0181\u0182\7n\2\2\u0182\u0183\7u\2\2\u0183\u0189\7g\2\2\u0184"+
+ "\u0185\7v\2\2\u0185\u0186\7t\2\2\u0186\u0187\7w\2\2\u0187\u0189\7g\2\2"+
+ "\u0188\u017f\3\2\2\2\u0188\u0184\3\2\2\2\u0189`\3\2\2\2\u018a\u018e\7"+
+ "$\2\2\u018b\u018d\t\6\2\2\u018c\u018b\3\2\2\2\u018d\u0190\3\2\2\2\u018e"+
+ "\u018c\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0191\3\2\2\2\u0190\u018e\3\2"+
+ "\2\2\u0191\u0192\7$\2\2\u0192b\3\2\2\2\u0193\u0195\5\25\13\2\u0194\u0193"+
+ "\3\2\2\2\u0195\u0196\3\2\2\2\u0196\u0194\3\2\2\2\u0196\u0197\3\2\2\2\u0197"+
+ "d\3\2\2\2\u0198\u0199\5[.\2\u0199\u019a\5c\62\2\u019af\3\2\2\2\u019b\u019e"+
+ "\5e\63\2\u019c\u019e\5c\62\2\u019d\u019b\3\2\2\2\u019d\u019c\3\2\2\2\u019e"+
+ "\u019f\3\2\2\2\u019f\u01a0\7\60\2\2\u01a0\u01a1\5c\62\2\u01a1h\3\2\2\2"+
+ "\u01a2\u01a3\5\31\r\2\u01a3j\3\2\2\2\u01a4\u01a9\5\31\r\2\u01a5\u01a6"+
+ "\7\60\2\2\u01a6\u01a8\5\31\r\2\u01a7\u01a5\3\2\2\2\u01a8\u01ab\3\2\2\2"+
+ "\u01a9\u01a7\3\2\2\2\u01a9\u01aa\3\2\2\2\u01aal\3\2\2\2\u01ab\u01a9\3"+
+ "\2\2\2\u01ac\u01b2\7\60\2\2\u01ad\u01b3\5a\61\2\u01ae\u01b0\7&\2\2\u01af"+
+ "\u01ae\3\2\2\2\u01af\u01b0\3\2\2\2\u01b0\u01b1\3\2\2\2\u01b1\u01b3\5\31"+
+ "\r\2\u01b2\u01ad\3\2\2\2\u01b2\u01af\3\2\2\2\u01b3n\3\2\2\2\u01b4\u01b8"+
+ "\5\31\r\2\u01b5\u01b7\5m\67\2\u01b6\u01b5\3\2\2\2\u01b7\u01ba\3\2\2\2"+
+ "\u01b8\u01b6\3\2\2\2\u01b8\u01b9\3\2\2\2\u01b9p\3\2\2\2\u01ba\u01b8\3"+
+ "\2\2\2\u01bb\u01ce\5o8\2\u01bc\u01be\7]\2\2\u01bd\u01bf\5\33\16\2\u01be"+
+ "\u01bd\3\2\2\2\u01be\u01bf\3\2\2\2\u01bf\u01c2\3\2\2\2\u01c0\u01c3\5c"+
+ "\62\2\u01c1\u01c3\5\31\r\2\u01c2\u01c0\3\2\2\2\u01c2\u01c1\3\2\2\2\u01c3"+
+ "\u01c5\3\2\2\2\u01c4\u01c6\5\33\16\2\u01c5\u01c4\3\2\2\2\u01c5\u01c6\3"+
+ "\2\2\2\u01c6\u01c7\3\2\2\2\u01c7\u01cb\7_\2\2\u01c8\u01ca\5m\67\2\u01c9"+
+ "\u01c8\3\2\2\2\u01ca\u01cd\3\2\2\2\u01cb\u01c9\3\2\2\2\u01cb\u01cc\3\2"+
+ "\2\2\u01cc\u01cf\3\2\2\2\u01cd\u01cb\3\2\2\2\u01ce\u01bc\3\2\2\2\u01cf"+
+ "\u01d0\3\2\2\2\u01d0\u01ce\3\2\2\2\u01d0\u01d1\3\2\2\2\u01d1r\3\2\2\2"+
+ "\u01d2\u01d4\5\33\16\2\u01d3\u01d2\3\2\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d8"+
+ "\3\2\2\2\u01d5\u01d7\5\23\n\2\u01d6\u01d5\3\2\2\2\u01d7\u01da\3\2\2\2"+
+ "\u01d8\u01d6\3\2\2\2\u01d8\u01d9\3\2\2\2\u01d9\u01db\3\2\2\2\u01da\u01d8"+
+ "\3\2\2\2\u01db\u01dd\5\35\17\2\u01dc\u01de\5\33\16\2\u01dd\u01dc\3\2\2"+
+ "\2\u01dd\u01de\3\2\2\2\u01de\u01e2\3\2\2\2\u01df\u01e1\5\23\n\2\u01e0"+
+ "\u01df\3\2\2\2\u01e1\u01e4\3\2\2\2\u01e2\u01e0\3\2\2\2\u01e2\u01e3\3\2"+
+ "\2\2\u01e3t\3\2\2\2\u01e4\u01e2\3\2\2\2\u01e5\u01e6\5\33\16\2\u01e6v\3"+
+ "\2\2\2\32\2\u0088\u008e\u0099\u009b\u00a1\u00ab\u0188\u018e\u0196\u019d"+
+ "\u01a9\u01af\u01b2\u01b8\u01be\u01c2\u01c5\u01cb\u01d0\u01d3\u01d8\u01dd"+
+ "\u01e2\3\b\2\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/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowListener.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowListener.java
new file mode 100644
index 00000000000..a0194be97f1
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowListener.java
@@ -0,0 +1,420 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+import org.antlr.v4.runtime.tree.ParseTreeListener;
+
+/**
+ * This interface defines a complete listener for a parse tree produced by
+ * {@link AuthnFlowParser}.
+ */
+public interface AuthnFlowListener extends ParseTreeListener {
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#flow}.
+ * @param ctx the parse tree
+ */
+ void enterFlow(AuthnFlowParser.FlowContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#flow}.
+ * @param ctx the parse tree
+ */
+ void exitFlow(AuthnFlowParser.FlowContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#header}.
+ * @param ctx the parse tree
+ */
+ void enterHeader(AuthnFlowParser.HeaderContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#header}.
+ * @param ctx the parse tree
+ */
+ void exitHeader(AuthnFlowParser.HeaderContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#qname}.
+ * @param ctx the parse tree
+ */
+ void enterQname(AuthnFlowParser.QnameContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#qname}.
+ * @param ctx the parse tree
+ */
+ void exitQname(AuthnFlowParser.QnameContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#base}.
+ * @param ctx the parse tree
+ */
+ void enterBase(AuthnFlowParser.BaseContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#base}.
+ * @param ctx the parse tree
+ */
+ void exitBase(AuthnFlowParser.BaseContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#inputs}.
+ * @param ctx the parse tree
+ */
+ void enterInputs(AuthnFlowParser.InputsContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#inputs}.
+ * @param ctx the parse tree
+ */
+ void exitInputs(AuthnFlowParser.InputsContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#short_var}.
+ * @param ctx the parse tree
+ */
+ void enterShort_var(AuthnFlowParser.Short_varContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#short_var}.
+ * @param ctx the parse tree
+ */
+ void exitShort_var(AuthnFlowParser.Short_varContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#statement}.
+ * @param ctx the parse tree
+ */
+ void enterStatement(AuthnFlowParser.StatementContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#statement}.
+ * @param ctx the parse tree
+ */
+ void exitStatement(AuthnFlowParser.StatementContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#preassign}.
+ * @param ctx the parse tree
+ */
+ void enterPreassign(AuthnFlowParser.PreassignContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#preassign}.
+ * @param ctx the parse tree
+ */
+ void exitPreassign(AuthnFlowParser.PreassignContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#preassign_catch}.
+ * @param ctx the parse tree
+ */
+ void enterPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#preassign_catch}.
+ * @param ctx the parse tree
+ */
+ void exitPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#variable}.
+ * @param ctx the parse tree
+ */
+ void enterVariable(AuthnFlowParser.VariableContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#variable}.
+ * @param ctx the parse tree
+ */
+ void exitVariable(AuthnFlowParser.VariableContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#flow_call}.
+ * @param ctx the parse tree
+ */
+ void enterFlow_call(AuthnFlowParser.Flow_callContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#flow_call}.
+ * @param ctx the parse tree
+ */
+ void exitFlow_call(AuthnFlowParser.Flow_callContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#overrides}.
+ * @param ctx the parse tree
+ */
+ void enterOverrides(AuthnFlowParser.OverridesContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#overrides}.
+ * @param ctx the parse tree
+ */
+ void exitOverrides(AuthnFlowParser.OverridesContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#action_call}.
+ * @param ctx the parse tree
+ */
+ void enterAction_call(AuthnFlowParser.Action_callContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#action_call}.
+ * @param ctx the parse tree
+ */
+ void exitAction_call(AuthnFlowParser.Action_callContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#rrf_call}.
+ * @param ctx the parse tree
+ */
+ void enterRrf_call(AuthnFlowParser.Rrf_callContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#rrf_call}.
+ * @param ctx the parse tree
+ */
+ void exitRrf_call(AuthnFlowParser.Rrf_callContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#log}.
+ * @param ctx the parse tree
+ */
+ void enterLog(AuthnFlowParser.LogContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#log}.
+ * @param ctx the parse tree
+ */
+ void exitLog(AuthnFlowParser.LogContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#static_call}.
+ * @param ctx the parse tree
+ */
+ void enterStatic_call(AuthnFlowParser.Static_callContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#static_call}.
+ * @param ctx the parse tree
+ */
+ void exitStatic_call(AuthnFlowParser.Static_callContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#oo_call}.
+ * @param ctx the parse tree
+ */
+ void enterOo_call(AuthnFlowParser.Oo_callContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#oo_call}.
+ * @param ctx the parse tree
+ */
+ void exitOo_call(AuthnFlowParser.Oo_callContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#argument}.
+ * @param ctx the parse tree
+ */
+ void enterArgument(AuthnFlowParser.ArgumentContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#argument}.
+ * @param ctx the parse tree
+ */
+ void exitArgument(AuthnFlowParser.ArgumentContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#simple_expr}.
+ * @param ctx the parse tree
+ */
+ void enterSimple_expr(AuthnFlowParser.Simple_exprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#simple_expr}.
+ * @param ctx the parse tree
+ */
+ void exitSimple_expr(AuthnFlowParser.Simple_exprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#literal}.
+ * @param ctx the parse tree
+ */
+ void enterLiteral(AuthnFlowParser.LiteralContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#literal}.
+ * @param ctx the parse tree
+ */
+ void exitLiteral(AuthnFlowParser.LiteralContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#expression}.
+ * @param ctx the parse tree
+ */
+ void enterExpression(AuthnFlowParser.ExpressionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#expression}.
+ * @param ctx the parse tree
+ */
+ void exitExpression(AuthnFlowParser.ExpressionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#array_expr}.
+ * @param ctx the parse tree
+ */
+ void enterArray_expr(AuthnFlowParser.Array_exprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#array_expr}.
+ * @param ctx the parse tree
+ */
+ void exitArray_expr(AuthnFlowParser.Array_exprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#object_expr}.
+ * @param ctx the parse tree
+ */
+ void enterObject_expr(AuthnFlowParser.Object_exprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#object_expr}.
+ * @param ctx the parse tree
+ */
+ void exitObject_expr(AuthnFlowParser.Object_exprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#assignment}.
+ * @param ctx the parse tree
+ */
+ void enterAssignment(AuthnFlowParser.AssignmentContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#assignment}.
+ * @param ctx the parse tree
+ */
+ void exitAssignment(AuthnFlowParser.AssignmentContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#keypair}.
+ * @param ctx the parse tree
+ */
+ void enterKeypair(AuthnFlowParser.KeypairContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#keypair}.
+ * @param ctx the parse tree
+ */
+ void exitKeypair(AuthnFlowParser.KeypairContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#rfac}.
+ * @param ctx the parse tree
+ */
+ void enterRfac(AuthnFlowParser.RfacContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#rfac}.
+ * @param ctx the parse tree
+ */
+ void exitRfac(AuthnFlowParser.RfacContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#finish}.
+ * @param ctx the parse tree
+ */
+ void enterFinish(AuthnFlowParser.FinishContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#finish}.
+ * @param ctx the parse tree
+ */
+ void exitFinish(AuthnFlowParser.FinishContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#choice}.
+ * @param ctx the parse tree
+ */
+ void enterChoice(AuthnFlowParser.ChoiceContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#choice}.
+ * @param ctx the parse tree
+ */
+ void exitChoice(AuthnFlowParser.ChoiceContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#option}.
+ * @param ctx the parse tree
+ */
+ void enterOption(AuthnFlowParser.OptionContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#option}.
+ * @param ctx the parse tree
+ */
+ void exitOption(AuthnFlowParser.OptionContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#ifelse}.
+ * @param ctx the parse tree
+ */
+ void enterIfelse(AuthnFlowParser.IfelseContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#ifelse}.
+ * @param ctx the parse tree
+ */
+ void exitIfelse(AuthnFlowParser.IfelseContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#caseof}.
+ * @param ctx the parse tree
+ */
+ void enterCaseof(AuthnFlowParser.CaseofContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#caseof}.
+ * @param ctx the parse tree
+ */
+ void exitCaseof(AuthnFlowParser.CaseofContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#boolean_op_expr}.
+ * @param ctx the parse tree
+ */
+ void enterBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#boolean_op_expr}.
+ * @param ctx the parse tree
+ */
+ void exitBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#boolean_expr}.
+ * @param ctx the parse tree
+ */
+ void enterBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#boolean_expr}.
+ * @param ctx the parse tree
+ */
+ void exitBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#elseblock}.
+ * @param ctx the parse tree
+ */
+ void enterElseblock(AuthnFlowParser.ElseblockContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#elseblock}.
+ * @param ctx the parse tree
+ */
+ void exitElseblock(AuthnFlowParser.ElseblockContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#loop}.
+ * @param ctx the parse tree
+ */
+ void enterLoop(AuthnFlowParser.LoopContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#loop}.
+ * @param ctx the parse tree
+ */
+ void exitLoop(AuthnFlowParser.LoopContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#loopy}.
+ * @param ctx the parse tree
+ */
+ void enterLoopy(AuthnFlowParser.LoopyContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#loopy}.
+ * @param ctx the parse tree
+ */
+ void exitLoopy(AuthnFlowParser.LoopyContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#quit_stmt}.
+ * @param ctx the parse tree
+ */
+ void enterQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#quit_stmt}.
+ * @param ctx the parse tree
+ */
+ void exitQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#statusr_block}.
+ * @param ctx the parse tree
+ */
+ void enterStatusr_block(AuthnFlowParser.Statusr_blockContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#statusr_block}.
+ * @param ctx the parse tree
+ */
+ void exitStatusr_block(AuthnFlowParser.Statusr_blockContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#statusr_allow}.
+ * @param ctx the parse tree
+ */
+ void enterStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#statusr_allow}.
+ * @param ctx the parse tree
+ */
+ void exitStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#statusr_reply}.
+ * @param ctx the parse tree
+ */
+ void enterStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#statusr_reply}.
+ * @param ctx the parse tree
+ */
+ void exitStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx);
+ /**
+ * Enter a parse tree produced by {@link AuthnFlowParser#statusr_until}.
+ * @param ctx the parse tree
+ */
+ void enterStatusr_until(AuthnFlowParser.Statusr_untilContext ctx);
+ /**
+ * Exit a parse tree produced by {@link AuthnFlowParser#statusr_until}.
+ * @param ctx the parse tree
+ */
+ void exitStatusr_until(AuthnFlowParser.Statusr_untilContext ctx);
+}
\ No newline at end of file
diff --git a/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowParser.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowParser.java
new file mode 100644
index 00000000000..00f9d9cd2dd
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowParser.java
@@ -0,0 +1,3923 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+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 AuthnFlowParser 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
+ T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, NL=9,
+ COMMENT=10, FLOWSTART=11, BASE=12, FLOWINPUTS=13, LOG=14, FLOWCALL=15,
+ ACTIONCALL=16, RRFCALL=17, STATUS_REQ=18, ALLOW=19, REPLY=20, UNTIL=21,
+ OVERRIDE=22, WHEN=23, OTHERWISE=24, REPEAT=25, ITERATE=26, MATCH=27, QUIT=28,
+ FINISH=29, RFAC=30, IS=31, NOT=32, AND=33, OR=34, SECS=35, TO=36, MAXTIMES=37,
+ USE=38, EQ=39, MINUS=40, NUL=41, BOOL=42, STRING=43, UINT=44, SINT=45,
+ DECIMAL=46, ALPHANUM=47, QNAME=48, EVALNUM=49, DOTEXPR=50, DOTIDXEXPR=51,
+ SPCOMMA=52, WS=53, INDENT=54, DEDENT=55;
+ public static final int
+ RULE_flow = 0, RULE_header = 1, RULE_qname = 2, RULE_base = 3, RULE_inputs = 4,
+ RULE_short_var = 5, RULE_statement = 6, RULE_preassign = 7, RULE_preassign_catch = 8,
+ RULE_variable = 9, RULE_flow_call = 10, RULE_overrides = 11, RULE_action_call = 12,
+ RULE_rrf_call = 13, RULE_log = 14, RULE_static_call = 15, RULE_oo_call = 16,
+ RULE_argument = 17, RULE_simple_expr = 18, RULE_literal = 19, RULE_expression = 20,
+ RULE_array_expr = 21, RULE_object_expr = 22, RULE_assignment = 23, RULE_keypair = 24,
+ RULE_rfac = 25, RULE_finish = 26, RULE_choice = 27, RULE_option = 28,
+ RULE_ifelse = 29, RULE_caseof = 30, RULE_boolean_op_expr = 31, RULE_boolean_expr = 32,
+ RULE_elseblock = 33, RULE_loop = 34, RULE_loopy = 35, RULE_quit_stmt = 36,
+ RULE_statusr_block = 37, RULE_statusr_allow = 38, RULE_statusr_reply = 39,
+ RULE_statusr_until = 40;
+ private static String[] makeRuleNames() {
+ return new String[] {
+ "flow", "header", "qname", "base", "inputs", "short_var", "statement",
+ "preassign", "preassign_catch", "variable", "flow_call", "overrides",
+ "action_call", "rrf_call", "log", "static_call", "oo_call", "argument",
+ "simple_expr", "literal", "expression", "array_expr", "object_expr",
+ "assignment", "keypair", "rfac", "finish", "choice", "option", "ifelse",
+ "caseof", "boolean_op_expr", "boolean_expr", "elseblock", "loop", "loopy",
+ "quit_stmt", "statusr_block", "statusr_allow", "statusr_reply", "statusr_until"
+ };
+ }
+ public static final String[] ruleNames = makeRuleNames();
+
+ private static String[] makeLiteralNames() {
+ return new String[] {
+ null, "'|'", "'$'", "'#'", "'['", "']'", "'{'", "'}'", "':'", null, null,
+ "'Flow'", "'Basepath'", "'Inputs'", "'Log'", "'Trigger'", "'Call'", "'RRF'",
+ "'Status requests'", "'Allow for'", "'Reply'", "'Until'", "'Override templates'",
+ "'When'", "'Otherwise'", "'Repeat'", "'Iterate over'", "'Match'", "'Quit'",
+ "'Finish'", "'RFAC'", "'is'", "'not'", "'and'", "'or'", "'seconds'",
+ "'to'", "'times max'", "'using'", "'='", "'-'", "'null'"
+ };
+ }
+ private static final String[] _LITERAL_NAMES = makeLiteralNames();
+ private static String[] makeSymbolicNames() {
+ return new String[] {
+ null, null, null, null, null, null, null, null, null, "NL", "COMMENT",
+ "FLOWSTART", "BASE", "FLOWINPUTS", "LOG", "FLOWCALL", "ACTIONCALL", "RRFCALL",
+ "STATUS_REQ", "ALLOW", "REPLY", "UNTIL", "OVERRIDE", "WHEN", "OTHERWISE",
+ "REPEAT", "ITERATE", "MATCH", "QUIT", "FINISH", "RFAC", "IS", "NOT",
+ "AND", "OR", "SECS", "TO", "MAXTIMES", "USE", "EQ", "MINUS", "NUL", "BOOL",
+ "STRING", "UINT", "SINT", "DECIMAL", "ALPHANUM", "QNAME", "EVALNUM",
+ "DOTEXPR", "DOTIDXEXPR", "SPCOMMA", "WS", "INDENT", "DEDENT"
+ };
+ }
+ 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 "AuthnFlow.g4"; }
+
+ @Override
+ public String[] getRuleNames() { return ruleNames; }
+
+ @Override
+ public String getSerializedATN() { return _serializedATN; }
+
+ @Override
+ public ATN getATN() { return _ATN; }
+
+ public AuthnFlowParser(TokenStream input) {
+ super(input);
+ _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+ }
+
+ public static class FlowContext extends ParserRuleContext {
+ public HeaderContext header() {
+ return getRuleContext(HeaderContext.class,0);
+ }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public FlowContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_flow; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterFlow(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitFlow(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitFlow(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final FlowContext flow() throws RecognitionException {
+ FlowContext _localctx = new FlowContext(_ctx, getState());
+ enterRule(_localctx, 0, RULE_flow);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(82);
+ header();
+ setState(84);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(83);
+ statement();
+ }
+ }
+ setState(86);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class HeaderContext extends ParserRuleContext {
+ public TerminalNode FLOWSTART() { return getToken(AuthnFlowParser.FLOWSTART, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public QnameContext qname() {
+ return getRuleContext(QnameContext.class,0);
+ }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public BaseContext base() {
+ return getRuleContext(BaseContext.class,0);
+ }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public InputsContext inputs() {
+ return getRuleContext(InputsContext.class,0);
+ }
+ public List NL() { return getTokens(AuthnFlowParser.NL); }
+ public TerminalNode NL(int i) {
+ return getToken(AuthnFlowParser.NL, i);
+ }
+ public HeaderContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_header; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterHeader(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitHeader(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitHeader(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final HeaderContext header() throws RecognitionException {
+ HeaderContext _localctx = new HeaderContext(_ctx, getState());
+ enterRule(_localctx, 2, RULE_header);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(88);
+ match(FLOWSTART);
+ setState(89);
+ match(WS);
+ setState(90);
+ qname();
+ setState(92);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(91);
+ match(WS);
+ }
+ }
+
+ setState(94);
+ match(INDENT);
+ setState(95);
+ base();
+ setState(97);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==FLOWINPUTS) {
+ {
+ setState(96);
+ inputs();
+ }
+ }
+
+ setState(99);
+ match(DEDENT);
+ setState(103);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==NL) {
+ {
+ {
+ setState(100);
+ match(NL);
+ }
+ }
+ setState(105);
+ _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 static class QnameContext extends ParserRuleContext {
+ public TerminalNode ALPHANUM() { return getToken(AuthnFlowParser.ALPHANUM, 0); }
+ public TerminalNode QNAME() { return getToken(AuthnFlowParser.QNAME, 0); }
+ public QnameContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_qname; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterQname(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitQname(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitQname(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final QnameContext qname() throws RecognitionException {
+ QnameContext _localctx = new QnameContext(_ctx, getState());
+ enterRule(_localctx, 4, RULE_qname);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(106);
+ _la = _input.LA(1);
+ if ( !(_la==ALPHANUM || _la==QNAME) ) {
+ _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 BaseContext extends ParserRuleContext {
+ public TerminalNode BASE() { return getToken(AuthnFlowParser.BASE, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode STRING() { return getToken(AuthnFlowParser.STRING, 0); }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public BaseContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_base; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterBase(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitBase(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitBase(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final BaseContext base() throws RecognitionException {
+ BaseContext _localctx = new BaseContext(_ctx, getState());
+ enterRule(_localctx, 6, RULE_base);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(108);
+ match(BASE);
+ setState(109);
+ match(WS);
+ setState(110);
+ match(STRING);
+ setState(112);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(111);
+ match(WS);
+ }
+ }
+
+ setState(114);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class InputsContext extends ParserRuleContext {
+ public TerminalNode FLOWINPUTS() { return getToken(AuthnFlowParser.FLOWINPUTS, 0); }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public List short_var() {
+ return getRuleContexts(Short_varContext.class);
+ }
+ public Short_varContext short_var(int i) {
+ return getRuleContext(Short_varContext.class,i);
+ }
+ public InputsContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_inputs; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterInputs(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitInputs(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitInputs(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final InputsContext inputs() throws RecognitionException {
+ InputsContext _localctx = new InputsContext(_ctx, getState());
+ enterRule(_localctx, 8, RULE_inputs);
+ int _la;
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(116);
+ match(FLOWINPUTS);
+ setState(119);
+ _errHandler.sync(this);
+ _alt = 1;
+ do {
+ switch (_alt) {
+ case 1:
+ {
+ {
+ setState(117);
+ match(WS);
+ setState(118);
+ short_var();
+ }
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(121);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,5,_ctx);
+ } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
+ setState(124);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(123);
+ match(WS);
+ }
+ }
+
+ setState(126);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Short_varContext extends ParserRuleContext {
+ public TerminalNode ALPHANUM() { return getToken(AuthnFlowParser.ALPHANUM, 0); }
+ public Short_varContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_short_var; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterShort_var(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitShort_var(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitShort_var(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Short_varContext short_var() throws RecognitionException {
+ Short_varContext _localctx = new Short_varContext(_ctx, getState());
+ enterRule(_localctx, 10, RULE_short_var);
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(128);
+ match(ALPHANUM);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class StatementContext extends ParserRuleContext {
+ public Flow_callContext flow_call() {
+ return getRuleContext(Flow_callContext.class,0);
+ }
+ public Action_callContext action_call() {
+ return getRuleContext(Action_callContext.class,0);
+ }
+ public Rrf_callContext rrf_call() {
+ return getRuleContext(Rrf_callContext.class,0);
+ }
+ public AssignmentContext assignment() {
+ return getRuleContext(AssignmentContext.class,0);
+ }
+ public LogContext log() {
+ return getRuleContext(LogContext.class,0);
+ }
+ public RfacContext rfac() {
+ return getRuleContext(RfacContext.class,0);
+ }
+ public FinishContext finish() {
+ return getRuleContext(FinishContext.class,0);
+ }
+ public IfelseContext ifelse() {
+ return getRuleContext(IfelseContext.class,0);
+ }
+ public ChoiceContext choice() {
+ return getRuleContext(ChoiceContext.class,0);
+ }
+ public LoopContext loop() {
+ return getRuleContext(LoopContext.class,0);
+ }
+ public LoopyContext loopy() {
+ return getRuleContext(LoopyContext.class,0);
+ }
+ public StatementContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_statement; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatement(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatement(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatement(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final StatementContext statement() throws RecognitionException {
+ StatementContext _localctx = new StatementContext(_ctx, getState());
+ enterRule(_localctx, 12, RULE_statement);
+ try {
+ setState(141);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
+ case 1:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(130);
+ flow_call();
+ }
+ break;
+ case 2:
+ enterOuterAlt(_localctx, 2);
+ {
+ setState(131);
+ action_call();
+ }
+ break;
+ case 3:
+ enterOuterAlt(_localctx, 3);
+ {
+ setState(132);
+ rrf_call();
+ }
+ break;
+ case 4:
+ enterOuterAlt(_localctx, 4);
+ {
+ setState(133);
+ assignment();
+ }
+ break;
+ case 5:
+ enterOuterAlt(_localctx, 5);
+ {
+ setState(134);
+ log();
+ }
+ break;
+ case 6:
+ enterOuterAlt(_localctx, 6);
+ {
+ setState(135);
+ rfac();
+ }
+ break;
+ case 7:
+ enterOuterAlt(_localctx, 7);
+ {
+ setState(136);
+ finish();
+ }
+ break;
+ case 8:
+ enterOuterAlt(_localctx, 8);
+ {
+ setState(137);
+ ifelse();
+ }
+ break;
+ case 9:
+ enterOuterAlt(_localctx, 9);
+ {
+ setState(138);
+ choice();
+ }
+ break;
+ case 10:
+ enterOuterAlt(_localctx, 10);
+ {
+ setState(139);
+ loop();
+ }
+ break;
+ case 11:
+ enterOuterAlt(_localctx, 11);
+ {
+ setState(140);
+ loopy();
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class PreassignContext extends ParserRuleContext {
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode EQ() { return getToken(AuthnFlowParser.EQ, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public PreassignContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_preassign; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterPreassign(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitPreassign(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitPreassign(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final PreassignContext preassign() throws RecognitionException {
+ PreassignContext _localctx = new PreassignContext(_ctx, getState());
+ enterRule(_localctx, 14, RULE_preassign);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(143);
+ variable();
+ setState(145);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(144);
+ match(WS);
+ }
+ }
+
+ setState(147);
+ match(EQ);
+ setState(149);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(148);
+ match(WS);
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Preassign_catchContext extends ParserRuleContext {
+ public Short_varContext short_var() {
+ return getRuleContext(Short_varContext.class,0);
+ }
+ public TerminalNode EQ() { return getToken(AuthnFlowParser.EQ, 0); }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public Preassign_catchContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_preassign_catch; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterPreassign_catch(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitPreassign_catch(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitPreassign_catch(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Preassign_catchContext preassign_catch() throws RecognitionException {
+ Preassign_catchContext _localctx = new Preassign_catchContext(_ctx, getState());
+ enterRule(_localctx, 16, RULE_preassign_catch);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(152);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(151);
+ variable();
+ }
+ }
+
+ setState(155);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(154);
+ match(WS);
+ }
+ }
+
+ setState(157);
+ match(T__0);
+ setState(159);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(158);
+ match(WS);
+ }
+ }
+
+ setState(161);
+ short_var();
+ setState(163);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(162);
+ match(WS);
+ }
+ }
+
+ setState(165);
+ match(EQ);
+ setState(167);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(166);
+ match(WS);
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class VariableContext extends ParserRuleContext {
+ public Short_varContext short_var() {
+ return getRuleContext(Short_varContext.class,0);
+ }
+ public TerminalNode QNAME() { return getToken(AuthnFlowParser.QNAME, 0); }
+ public TerminalNode DOTEXPR() { return getToken(AuthnFlowParser.DOTEXPR, 0); }
+ public TerminalNode DOTIDXEXPR() { return getToken(AuthnFlowParser.DOTIDXEXPR, 0); }
+ public VariableContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_variable; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterVariable(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitVariable(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitVariable(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final VariableContext variable() throws RecognitionException {
+ VariableContext _localctx = new VariableContext(_ctx, getState());
+ enterRule(_localctx, 18, RULE_variable);
+ try {
+ setState(173);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case ALPHANUM:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(169);
+ short_var();
+ }
+ break;
+ case QNAME:
+ enterOuterAlt(_localctx, 2);
+ {
+ setState(170);
+ match(QNAME);
+ }
+ break;
+ case DOTEXPR:
+ enterOuterAlt(_localctx, 3);
+ {
+ setState(171);
+ match(DOTEXPR);
+ }
+ break;
+ case DOTIDXEXPR:
+ enterOuterAlt(_localctx, 4);
+ {
+ setState(172);
+ match(DOTIDXEXPR);
+ }
+ 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 Flow_callContext extends ParserRuleContext {
+ public TerminalNode FLOWCALL() { return getToken(AuthnFlowParser.FLOWCALL, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public QnameContext qname() {
+ return getRuleContext(QnameContext.class,0);
+ }
+ public OverridesContext overrides() {
+ return getRuleContext(OverridesContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public List argument() {
+ return getRuleContexts(ArgumentContext.class);
+ }
+ public ArgumentContext argument(int i) {
+ return getRuleContext(ArgumentContext.class,i);
+ }
+ public Flow_callContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_flow_call; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterFlow_call(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitFlow_call(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitFlow_call(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Flow_callContext flow_call() throws RecognitionException {
+ Flow_callContext _localctx = new Flow_callContext(_ctx, getState());
+ enterRule(_localctx, 20, RULE_flow_call);
+ int _la;
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(176);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(175);
+ preassign();
+ }
+ }
+
+ setState(178);
+ match(FLOWCALL);
+ setState(179);
+ match(WS);
+ setState(183);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case T__1:
+ {
+ setState(180);
+ match(T__1);
+ setState(181);
+ variable();
+ }
+ break;
+ case ALPHANUM:
+ case QNAME:
+ {
+ setState(182);
+ qname();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(188);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,18,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(185);
+ argument();
+ }
+ }
+ }
+ setState(190);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,18,_ctx);
+ }
+ setState(192);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(191);
+ match(WS);
+ }
+ }
+
+ setState(196);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case INDENT:
+ {
+ setState(194);
+ overrides();
+ }
+ break;
+ case NL:
+ {
+ setState(195);
+ match(NL);
+ }
+ 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 OverridesContext extends ParserRuleContext {
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode OVERRIDE() { return getToken(AuthnFlowParser.OVERRIDE, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public List STRING() { return getTokens(AuthnFlowParser.STRING); }
+ public TerminalNode STRING(int i) {
+ return getToken(AuthnFlowParser.STRING, i);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public OverridesContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_overrides; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterOverrides(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitOverrides(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitOverrides(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final OverridesContext overrides() throws RecognitionException {
+ OverridesContext _localctx = new OverridesContext(_ctx, getState());
+ enterRule(_localctx, 22, RULE_overrides);
+ int _la;
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(198);
+ match(INDENT);
+ setState(199);
+ match(OVERRIDE);
+ setState(200);
+ match(WS);
+ setState(201);
+ match(STRING);
+ setState(206);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,21,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(202);
+ match(WS);
+ setState(203);
+ match(STRING);
+ }
+ }
+ }
+ setState(208);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,21,_ctx);
+ }
+ setState(210);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(209);
+ match(WS);
+ }
+ }
+
+ setState(212);
+ match(NL);
+ setState(213);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Action_callContext extends ParserRuleContext {
+ public TerminalNode ACTIONCALL() { return getToken(AuthnFlowParser.ACTIONCALL, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public Static_callContext static_call() {
+ return getRuleContext(Static_callContext.class,0);
+ }
+ public Oo_callContext oo_call() {
+ return getRuleContext(Oo_callContext.class,0);
+ }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public Preassign_catchContext preassign_catch() {
+ return getRuleContext(Preassign_catchContext.class,0);
+ }
+ public Action_callContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_action_call; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterAction_call(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitAction_call(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitAction_call(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Action_callContext action_call() throws RecognitionException {
+ Action_callContext _localctx = new Action_callContext(_ctx, getState());
+ enterRule(_localctx, 24, RULE_action_call);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(217);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
+ case 1:
+ {
+ setState(215);
+ preassign();
+ }
+ break;
+ case 2:
+ {
+ setState(216);
+ preassign_catch();
+ }
+ break;
+ }
+ setState(219);
+ match(ACTIONCALL);
+ setState(220);
+ match(WS);
+ setState(223);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
+ case 1:
+ {
+ setState(221);
+ static_call();
+ }
+ break;
+ case 2:
+ {
+ setState(222);
+ oo_call();
+ }
+ break;
+ }
+ setState(226);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(225);
+ match(WS);
+ }
+ }
+
+ setState(228);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Rrf_callContext extends ParserRuleContext {
+ public TerminalNode RRFCALL() { return getToken(AuthnFlowParser.RRFCALL, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode STRING() { return getToken(AuthnFlowParser.STRING, 0); }
+ public Statusr_blockContext statusr_block() {
+ return getRuleContext(Statusr_blockContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode BOOL() { return getToken(AuthnFlowParser.BOOL, 0); }
+ public Rrf_callContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_rrf_call; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterRrf_call(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitRrf_call(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitRrf_call(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Rrf_callContext rrf_call() throws RecognitionException {
+ Rrf_callContext _localctx = new Rrf_callContext(_ctx, getState());
+ enterRule(_localctx, 26, RULE_rrf_call);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(231);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(230);
+ preassign();
+ }
+ }
+
+ setState(233);
+ match(RRFCALL);
+ setState(234);
+ match(WS);
+ setState(235);
+ match(STRING);
+ setState(238);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
+ case 1:
+ {
+ setState(236);
+ match(WS);
+ setState(237);
+ variable();
+ }
+ break;
+ }
+ setState(242);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
+ case 1:
+ {
+ setState(240);
+ match(WS);
+ setState(241);
+ match(BOOL);
+ }
+ break;
+ }
+ setState(245);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(244);
+ match(WS);
+ }
+ }
+
+ setState(249);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case INDENT:
+ {
+ setState(247);
+ statusr_block();
+ }
+ break;
+ case NL:
+ {
+ setState(248);
+ match(NL);
+ }
+ 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 LogContext extends ParserRuleContext {
+ public TerminalNode LOG() { return getToken(AuthnFlowParser.LOG, 0); }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public List argument() {
+ return getRuleContexts(ArgumentContext.class);
+ }
+ public ArgumentContext argument(int i) {
+ return getRuleContext(ArgumentContext.class,i);
+ }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public LogContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_log; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterLog(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitLog(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitLog(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final LogContext log() throws RecognitionException {
+ LogContext _localctx = new LogContext(_ctx, getState());
+ enterRule(_localctx, 28, RULE_log);
+ int _la;
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(251);
+ match(LOG);
+ setState(253);
+ _errHandler.sync(this);
+ _alt = 1;
+ do {
+ switch (_alt) {
+ case 1:
+ {
+ {
+ setState(252);
+ argument();
+ }
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(255);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,31,_ctx);
+ } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
+ setState(258);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(257);
+ match(WS);
+ }
+ }
+
+ setState(260);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Static_callContext extends ParserRuleContext {
+ public QnameContext qname() {
+ return getRuleContext(QnameContext.class,0);
+ }
+ public TerminalNode ALPHANUM() { return getToken(AuthnFlowParser.ALPHANUM, 0); }
+ public List argument() {
+ return getRuleContexts(ArgumentContext.class);
+ }
+ public ArgumentContext argument(int i) {
+ return getRuleContext(ArgumentContext.class,i);
+ }
+ public Static_callContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_static_call; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatic_call(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatic_call(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatic_call(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Static_callContext static_call() throws RecognitionException {
+ Static_callContext _localctx = new Static_callContext(_ctx, getState());
+ enterRule(_localctx, 30, RULE_static_call);
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(262);
+ qname();
+ setState(263);
+ match(T__2);
+ setState(264);
+ match(ALPHANUM);
+ setState(268);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(265);
+ argument();
+ }
+ }
+ }
+ setState(270);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Oo_callContext extends ParserRuleContext {
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public TerminalNode ALPHANUM() { return getToken(AuthnFlowParser.ALPHANUM, 0); }
+ public List argument() {
+ return getRuleContexts(ArgumentContext.class);
+ }
+ public ArgumentContext argument(int i) {
+ return getRuleContext(ArgumentContext.class,i);
+ }
+ public Oo_callContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_oo_call; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterOo_call(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitOo_call(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitOo_call(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Oo_callContext oo_call() throws RecognitionException {
+ Oo_callContext _localctx = new Oo_callContext(_ctx, getState());
+ enterRule(_localctx, 32, RULE_oo_call);
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(271);
+ variable();
+ setState(272);
+ match(WS);
+ setState(273);
+ match(ALPHANUM);
+ setState(277);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,34,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(274);
+ argument();
+ }
+ }
+ }
+ setState(279);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,34,_ctx);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class ArgumentContext extends ParserRuleContext {
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public Simple_exprContext simple_expr() {
+ return getRuleContext(Simple_exprContext.class,0);
+ }
+ public ArgumentContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_argument; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterArgument(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitArgument(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitArgument(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final ArgumentContext argument() throws RecognitionException {
+ ArgumentContext _localctx = new ArgumentContext(_ctx, getState());
+ enterRule(_localctx, 34, RULE_argument);
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(280);
+ match(WS);
+ setState(281);
+ simple_expr();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Simple_exprContext extends ParserRuleContext {
+ public LiteralContext literal() {
+ return getRuleContext(LiteralContext.class,0);
+ }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode MINUS() { return getToken(AuthnFlowParser.MINUS, 0); }
+ public Simple_exprContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_simple_expr; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterSimple_expr(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitSimple_expr(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitSimple_expr(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Simple_exprContext simple_expr() throws RecognitionException {
+ Simple_exprContext _localctx = new Simple_exprContext(_ctx, getState());
+ enterRule(_localctx, 36, RULE_simple_expr);
+ try {
+ setState(287);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case NUL:
+ case BOOL:
+ case STRING:
+ case UINT:
+ case SINT:
+ case DECIMAL:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(283);
+ literal();
+ }
+ break;
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ enterOuterAlt(_localctx, 2);
+ {
+ setState(284);
+ variable();
+ }
+ break;
+ case MINUS:
+ enterOuterAlt(_localctx, 3);
+ {
+ {
+ setState(285);
+ match(MINUS);
+ setState(286);
+ variable();
+ }
+ }
+ 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 LiteralContext extends ParserRuleContext {
+ public TerminalNode BOOL() { return getToken(AuthnFlowParser.BOOL, 0); }
+ public TerminalNode STRING() { return getToken(AuthnFlowParser.STRING, 0); }
+ public TerminalNode UINT() { return getToken(AuthnFlowParser.UINT, 0); }
+ public TerminalNode SINT() { return getToken(AuthnFlowParser.SINT, 0); }
+ public TerminalNode DECIMAL() { return getToken(AuthnFlowParser.DECIMAL, 0); }
+ public TerminalNode NUL() { return getToken(AuthnFlowParser.NUL, 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 AuthnFlowListener ) ((AuthnFlowListener)listener).enterLiteral(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitLiteral(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitLiteral(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final LiteralContext literal() throws RecognitionException {
+ LiteralContext _localctx = new LiteralContext(_ctx, getState());
+ enterRule(_localctx, 38, RULE_literal);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(289);
+ _la = _input.LA(1);
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NUL) | (1L << BOOL) | (1L << STRING) | (1L << UINT) | (1L << SINT) | (1L << DECIMAL))) != 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 ExpressionContext extends ParserRuleContext {
+ public Object_exprContext object_expr() {
+ return getRuleContext(Object_exprContext.class,0);
+ }
+ public Array_exprContext array_expr() {
+ return getRuleContext(Array_exprContext.class,0);
+ }
+ public Simple_exprContext simple_expr() {
+ return getRuleContext(Simple_exprContext.class,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 AuthnFlowListener ) ((AuthnFlowListener)listener).enterExpression(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitExpression(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitExpression(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final ExpressionContext expression() throws RecognitionException {
+ ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
+ enterRule(_localctx, 40, RULE_expression);
+ try {
+ setState(294);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case T__5:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(291);
+ object_expr();
+ }
+ break;
+ case T__3:
+ enterOuterAlt(_localctx, 2);
+ {
+ setState(292);
+ array_expr();
+ }
+ break;
+ case MINUS:
+ case NUL:
+ case BOOL:
+ case STRING:
+ case UINT:
+ case SINT:
+ case DECIMAL:
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ enterOuterAlt(_localctx, 3);
+ {
+ setState(293);
+ simple_expr();
+ }
+ 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 Array_exprContext extends ParserRuleContext {
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public List expression() {
+ return getRuleContexts(ExpressionContext.class);
+ }
+ public ExpressionContext expression(int i) {
+ return getRuleContext(ExpressionContext.class,i);
+ }
+ public List SPCOMMA() { return getTokens(AuthnFlowParser.SPCOMMA); }
+ public TerminalNode SPCOMMA(int i) {
+ return getToken(AuthnFlowParser.SPCOMMA, i);
+ }
+ public Array_exprContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_array_expr; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterArray_expr(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitArray_expr(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitArray_expr(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Array_exprContext array_expr() throws RecognitionException {
+ Array_exprContext _localctx = new Array_exprContext(_ctx, getState());
+ enterRule(_localctx, 42, RULE_array_expr);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(296);
+ match(T__3);
+ setState(298);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) {
+ case 1:
+ {
+ setState(297);
+ match(WS);
+ }
+ break;
+ }
+ setState(303);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__5) | (1L << MINUS) | (1L << NUL) | (1L << BOOL) | (1L << STRING) | (1L << UINT) | (1L << SINT) | (1L << DECIMAL) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ {
+ setState(300);
+ expression();
+ }
+ }
+ setState(305);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(310);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==SPCOMMA) {
+ {
+ {
+ setState(306);
+ match(SPCOMMA);
+ setState(307);
+ expression();
+ }
+ }
+ setState(312);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(314);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(313);
+ match(WS);
+ }
+ }
+
+ setState(316);
+ match(T__4);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Object_exprContext extends ParserRuleContext {
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public List keypair() {
+ return getRuleContexts(KeypairContext.class);
+ }
+ public KeypairContext keypair(int i) {
+ return getRuleContext(KeypairContext.class,i);
+ }
+ public List SPCOMMA() { return getTokens(AuthnFlowParser.SPCOMMA); }
+ public TerminalNode SPCOMMA(int i) {
+ return getToken(AuthnFlowParser.SPCOMMA, i);
+ }
+ public Object_exprContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_object_expr; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterObject_expr(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitObject_expr(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitObject_expr(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Object_exprContext object_expr() throws RecognitionException {
+ Object_exprContext _localctx = new Object_exprContext(_ctx, getState());
+ enterRule(_localctx, 44, RULE_object_expr);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(318);
+ match(T__5);
+ setState(320);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,41,_ctx) ) {
+ case 1:
+ {
+ setState(319);
+ match(WS);
+ }
+ break;
+ }
+ setState(325);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==ALPHANUM) {
+ {
+ {
+ setState(322);
+ keypair();
+ }
+ }
+ setState(327);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(332);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==SPCOMMA) {
+ {
+ {
+ setState(328);
+ match(SPCOMMA);
+ setState(329);
+ keypair();
+ }
+ }
+ setState(334);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(336);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(335);
+ match(WS);
+ }
+ }
+
+ setState(338);
+ match(T__6);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class AssignmentContext extends ParserRuleContext {
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public ExpressionContext expression() {
+ return getRuleContext(ExpressionContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public AssignmentContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_assignment; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterAssignment(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitAssignment(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitAssignment(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final AssignmentContext assignment() throws RecognitionException {
+ AssignmentContext _localctx = new AssignmentContext(_ctx, getState());
+ enterRule(_localctx, 46, RULE_assignment);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(340);
+ preassign();
+ setState(341);
+ expression();
+ setState(343);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(342);
+ match(WS);
+ }
+ }
+
+ setState(345);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class KeypairContext extends ParserRuleContext {
+ public TerminalNode ALPHANUM() { return getToken(AuthnFlowParser.ALPHANUM, 0); }
+ public ExpressionContext expression() {
+ return getRuleContext(ExpressionContext.class,0);
+ }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public KeypairContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_keypair; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterKeypair(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitKeypair(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitKeypair(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final KeypairContext keypair() throws RecognitionException {
+ KeypairContext _localctx = new KeypairContext(_ctx, getState());
+ enterRule(_localctx, 48, RULE_keypair);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(347);
+ match(ALPHANUM);
+ setState(349);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(348);
+ match(WS);
+ }
+ }
+
+ setState(351);
+ match(T__7);
+ setState(353);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(352);
+ match(WS);
+ }
+ }
+
+ setState(355);
+ expression();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class RfacContext extends ParserRuleContext {
+ public TerminalNode RFAC() { return getToken(AuthnFlowParser.RFAC, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public TerminalNode STRING() { return getToken(AuthnFlowParser.STRING, 0); }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public RfacContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_rfac; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterRfac(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitRfac(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitRfac(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final RfacContext rfac() throws RecognitionException {
+ RfacContext _localctx = new RfacContext(_ctx, getState());
+ enterRule(_localctx, 50, RULE_rfac);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(358);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(357);
+ preassign();
+ }
+ }
+
+ setState(360);
+ match(RFAC);
+ setState(361);
+ match(WS);
+ setState(364);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case STRING:
+ {
+ setState(362);
+ match(STRING);
+ }
+ break;
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ {
+ setState(363);
+ variable();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(366);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class FinishContext extends ParserRuleContext {
+ public TerminalNode FINISH() { return getToken(AuthnFlowParser.FINISH, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public TerminalNode BOOL() { return getToken(AuthnFlowParser.BOOL, 0); }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public FinishContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_finish; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterFinish(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitFinish(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitFinish(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final FinishContext finish() throws RecognitionException {
+ FinishContext _localctx = new FinishContext(_ctx, getState());
+ enterRule(_localctx, 52, RULE_finish);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(368);
+ match(FINISH);
+ setState(369);
+ match(WS);
+ setState(372);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case BOOL:
+ {
+ setState(370);
+ match(BOOL);
+ }
+ break;
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ {
+ setState(371);
+ variable();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(375);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(374);
+ match(WS);
+ }
+ }
+
+ setState(377);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class ChoiceContext extends ParserRuleContext {
+ public TerminalNode MATCH() { return getToken(AuthnFlowParser.MATCH, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public Simple_exprContext simple_expr() {
+ return getRuleContext(Simple_exprContext.class,0);
+ }
+ public TerminalNode TO() { return getToken(AuthnFlowParser.TO, 0); }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public List option() {
+ return getRuleContexts(OptionContext.class);
+ }
+ public OptionContext option(int i) {
+ return getRuleContext(OptionContext.class,i);
+ }
+ public ElseblockContext elseblock() {
+ return getRuleContext(ElseblockContext.class,0);
+ }
+ public ChoiceContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_choice; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterChoice(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitChoice(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitChoice(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final ChoiceContext choice() throws RecognitionException {
+ ChoiceContext _localctx = new ChoiceContext(_ctx, getState());
+ enterRule(_localctx, 54, RULE_choice);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(379);
+ match(MATCH);
+ setState(380);
+ match(WS);
+ setState(381);
+ simple_expr();
+ setState(382);
+ match(WS);
+ setState(383);
+ match(TO);
+ setState(385);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(384);
+ match(WS);
+ }
+ }
+
+ setState(387);
+ match(INDENT);
+ setState(389);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(388);
+ option();
+ }
+ }
+ setState(391);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MINUS) | (1L << NUL) | (1L << BOOL) | (1L << STRING) | (1L << UINT) | (1L << SINT) | (1L << DECIMAL) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0) );
+ setState(393);
+ match(DEDENT);
+ setState(395);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==OTHERWISE) {
+ {
+ setState(394);
+ elseblock();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class OptionContext extends ParserRuleContext {
+ public Simple_exprContext simple_expr() {
+ return getRuleContext(Simple_exprContext.class,0);
+ }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public OptionContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_option; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterOption(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitOption(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitOption(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final OptionContext option() throws RecognitionException {
+ OptionContext _localctx = new OptionContext(_ctx, getState());
+ enterRule(_localctx, 56, RULE_option);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(397);
+ simple_expr();
+ setState(399);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(398);
+ match(WS);
+ }
+ }
+
+ setState(401);
+ match(INDENT);
+ setState(403);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(402);
+ statement();
+ }
+ }
+ setState(405);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ setState(407);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class IfelseContext extends ParserRuleContext {
+ public CaseofContext caseof() {
+ return getRuleContext(CaseofContext.class,0);
+ }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public ElseblockContext elseblock() {
+ return getRuleContext(ElseblockContext.class,0);
+ }
+ public IfelseContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_ifelse; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterIfelse(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitIfelse(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitIfelse(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final IfelseContext ifelse() throws RecognitionException {
+ IfelseContext _localctx = new IfelseContext(_ctx, getState());
+ enterRule(_localctx, 58, RULE_ifelse);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(409);
+ caseof();
+ setState(410);
+ match(INDENT);
+ setState(412);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(411);
+ statement();
+ }
+ }
+ setState(414);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ setState(416);
+ match(DEDENT);
+ setState(418);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==OTHERWISE) {
+ {
+ setState(417);
+ elseblock();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class CaseofContext extends ParserRuleContext {
+ public TerminalNode WHEN() { return getToken(AuthnFlowParser.WHEN, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public Boolean_exprContext boolean_expr() {
+ return getRuleContext(Boolean_exprContext.class,0);
+ }
+ public List boolean_op_expr() {
+ return getRuleContexts(Boolean_op_exprContext.class);
+ }
+ public Boolean_op_exprContext boolean_op_expr(int i) {
+ return getRuleContext(Boolean_op_exprContext.class,i);
+ }
+ public CaseofContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_caseof; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterCaseof(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitCaseof(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitCaseof(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final CaseofContext caseof() throws RecognitionException {
+ CaseofContext _localctx = new CaseofContext(_ctx, getState());
+ enterRule(_localctx, 60, RULE_caseof);
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(420);
+ match(WHEN);
+ setState(421);
+ match(WS);
+ setState(422);
+ boolean_expr();
+ setState(426);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,59,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(423);
+ boolean_op_expr();
+ }
+ }
+ }
+ setState(428);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,59,_ctx);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Boolean_op_exprContext extends ParserRuleContext {
+ public Boolean_exprContext boolean_expr() {
+ return getRuleContext(Boolean_exprContext.class,0);
+ }
+ public TerminalNode AND() { return getToken(AuthnFlowParser.AND, 0); }
+ public TerminalNode OR() { return getToken(AuthnFlowParser.OR, 0); }
+ public List NL() { return getTokens(AuthnFlowParser.NL); }
+ public TerminalNode NL(int i) {
+ return getToken(AuthnFlowParser.NL, i);
+ }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public Boolean_op_exprContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_boolean_op_expr; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterBoolean_op_expr(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitBoolean_op_expr(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitBoolean_op_expr(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Boolean_op_exprContext boolean_op_expr() throws RecognitionException {
+ Boolean_op_exprContext _localctx = new Boolean_op_exprContext(_ctx, getState());
+ enterRule(_localctx, 62, RULE_boolean_op_expr);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(432);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==NL) {
+ {
+ {
+ setState(429);
+ match(NL);
+ }
+ }
+ setState(434);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(435);
+ _la = _input.LA(1);
+ if ( !(_la==AND || _la==OR) ) {
+ _errHandler.recoverInline(this);
+ }
+ else {
+ if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
+ _errHandler.reportMatch(this);
+ consume();
+ }
+ setState(437);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(436);
+ match(WS);
+ }
+ }
+
+ setState(442);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==NL) {
+ {
+ {
+ setState(439);
+ match(NL);
+ }
+ }
+ setState(444);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(445);
+ boolean_expr();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Boolean_exprContext extends ParserRuleContext {
+ public List simple_expr() {
+ return getRuleContexts(Simple_exprContext.class);
+ }
+ public Simple_exprContext simple_expr(int i) {
+ return getRuleContext(Simple_exprContext.class,i);
+ }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode IS() { return getToken(AuthnFlowParser.IS, 0); }
+ public TerminalNode NOT() { return getToken(AuthnFlowParser.NOT, 0); }
+ public Boolean_exprContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_boolean_expr; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterBoolean_expr(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitBoolean_expr(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitBoolean_expr(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Boolean_exprContext boolean_expr() throws RecognitionException {
+ Boolean_exprContext _localctx = new Boolean_exprContext(_ctx, getState());
+ enterRule(_localctx, 64, RULE_boolean_expr);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(447);
+ simple_expr();
+ setState(448);
+ match(WS);
+ setState(449);
+ match(IS);
+ setState(450);
+ match(WS);
+ setState(453);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==NOT) {
+ {
+ setState(451);
+ match(NOT);
+ setState(452);
+ match(WS);
+ }
+ }
+
+ setState(455);
+ simple_expr();
+ setState(457);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,64,_ctx) ) {
+ case 1:
+ {
+ setState(456);
+ match(WS);
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class ElseblockContext extends ParserRuleContext {
+ public TerminalNode OTHERWISE() { return getToken(AuthnFlowParser.OTHERWISE, 0); }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public ElseblockContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_elseblock; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterElseblock(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitElseblock(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitElseblock(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final ElseblockContext elseblock() throws RecognitionException {
+ ElseblockContext _localctx = new ElseblockContext(_ctx, getState());
+ enterRule(_localctx, 66, RULE_elseblock);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(459);
+ match(OTHERWISE);
+ setState(461);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(460);
+ match(WS);
+ }
+ }
+
+ setState(463);
+ match(INDENT);
+ setState(465);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(464);
+ statement();
+ }
+ }
+ setState(467);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ setState(469);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class LoopContext extends ParserRuleContext {
+ public TerminalNode ITERATE() { return getToken(AuthnFlowParser.ITERATE, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode USE() { return getToken(AuthnFlowParser.USE, 0); }
+ public Short_varContext short_var() {
+ return getRuleContext(Short_varContext.class,0);
+ }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public Quit_stmtContext quit_stmt() {
+ return getRuleContext(Quit_stmtContext.class,0);
+ }
+ public LoopContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_loop; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterLoop(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitLoop(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitLoop(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final LoopContext loop() throws RecognitionException {
+ LoopContext _localctx = new LoopContext(_ctx, getState());
+ enterRule(_localctx, 68, RULE_loop);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(472);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(471);
+ preassign();
+ }
+ }
+
+ setState(474);
+ match(ITERATE);
+ setState(475);
+ match(WS);
+ setState(476);
+ variable();
+ setState(477);
+ match(WS);
+ setState(478);
+ match(USE);
+ setState(479);
+ match(WS);
+ setState(480);
+ short_var();
+ setState(481);
+ match(INDENT);
+ setState(483);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(482);
+ statement();
+ }
+ }
+ setState(485);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ setState(488);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==QUIT) {
+ {
+ setState(487);
+ quit_stmt();
+ }
+ }
+
+ setState(490);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class LoopyContext extends ParserRuleContext {
+ public TerminalNode REPEAT() { return getToken(AuthnFlowParser.REPEAT, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode MAXTIMES() { return getToken(AuthnFlowParser.MAXTIMES, 0); }
+ public TerminalNode INDENT() { return getToken(AuthnFlowParser.INDENT, 0); }
+ public TerminalNode DEDENT() { return getToken(AuthnFlowParser.DEDENT, 0); }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode UINT() { return getToken(AuthnFlowParser.UINT, 0); }
+ public PreassignContext preassign() {
+ return getRuleContext(PreassignContext.class,0);
+ }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public Quit_stmtContext quit_stmt() {
+ return getRuleContext(Quit_stmtContext.class,0);
+ }
+ public LoopyContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_loopy; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterLoopy(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitLoopy(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitLoopy(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final LoopyContext loopy() throws RecognitionException {
+ LoopyContext _localctx = new LoopyContext(_ctx, getState());
+ enterRule(_localctx, 70, RULE_loopy);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(493);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR))) != 0)) {
+ {
+ setState(492);
+ preassign();
+ }
+ }
+
+ setState(495);
+ match(REPEAT);
+ setState(496);
+ match(WS);
+ setState(499);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ {
+ setState(497);
+ variable();
+ }
+ break;
+ case UINT:
+ {
+ setState(498);
+ match(UINT);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(501);
+ match(WS);
+ setState(502);
+ match(MAXTIMES);
+ setState(504);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(503);
+ match(WS);
+ }
+ }
+
+ setState(506);
+ match(INDENT);
+ setState(508);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(507);
+ statement();
+ }
+ }
+ setState(510);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0) );
+ setState(513);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==QUIT) {
+ {
+ setState(512);
+ quit_stmt();
+ }
+ }
+
+ setState(515);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Quit_stmtContext extends ParserRuleContext {
+ public TerminalNode QUIT() { return getToken(AuthnFlowParser.QUIT, 0); }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public CaseofContext caseof() {
+ return getRuleContext(CaseofContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public List statement() {
+ return getRuleContexts(StatementContext.class);
+ }
+ public StatementContext statement(int i) {
+ return getRuleContext(StatementContext.class,i);
+ }
+ public Quit_stmtContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_quit_stmt; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterQuit_stmt(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitQuit_stmt(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitQuit_stmt(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Quit_stmtContext quit_stmt() throws RecognitionException {
+ Quit_stmtContext _localctx = new Quit_stmtContext(_ctx, getState());
+ enterRule(_localctx, 72, RULE_quit_stmt);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(517);
+ match(QUIT);
+ setState(518);
+ match(WS);
+ setState(519);
+ caseof();
+ setState(520);
+ match(NL);
+ setState(524);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << LOG) | (1L << FLOWCALL) | (1L << ACTIONCALL) | (1L << RRFCALL) | (1L << WHEN) | (1L << REPEAT) | (1L << ITERATE) | (1L << MATCH) | (1L << FINISH) | (1L << RFAC) | (1L << ALPHANUM) | (1L << QNAME) | (1L << DOTEXPR) | (1L << DOTIDXEXPR) | (1L << WS))) != 0)) {
+ {
+ {
+ setState(521);
+ statement();
+ }
+ }
+ setState(526);
+ _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 static class Statusr_blockContext extends ParserRuleContext {
+ public List INDENT() { return getTokens(AuthnFlowParser.INDENT); }
+ public TerminalNode INDENT(int i) {
+ return getToken(AuthnFlowParser.INDENT, i);
+ }
+ public TerminalNode STATUS_REQ() { return getToken(AuthnFlowParser.STATUS_REQ, 0); }
+ public Statusr_allowContext statusr_allow() {
+ return getRuleContext(Statusr_allowContext.class,0);
+ }
+ public Statusr_replyContext statusr_reply() {
+ return getRuleContext(Statusr_replyContext.class,0);
+ }
+ public Statusr_untilContext statusr_until() {
+ return getRuleContext(Statusr_untilContext.class,0);
+ }
+ public List DEDENT() { return getTokens(AuthnFlowParser.DEDENT); }
+ public TerminalNode DEDENT(int i) {
+ return getToken(AuthnFlowParser.DEDENT, i);
+ }
+ public TerminalNode WS() { return getToken(AuthnFlowParser.WS, 0); }
+ public Statusr_blockContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_statusr_block; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatusr_block(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatusr_block(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatusr_block(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Statusr_blockContext statusr_block() throws RecognitionException {
+ Statusr_blockContext _localctx = new Statusr_blockContext(_ctx, getState());
+ enterRule(_localctx, 74, RULE_statusr_block);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(527);
+ match(INDENT);
+ setState(528);
+ match(STATUS_REQ);
+ setState(530);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(529);
+ match(WS);
+ }
+ }
+
+ setState(532);
+ match(INDENT);
+ setState(533);
+ statusr_allow();
+ setState(534);
+ statusr_reply();
+ setState(535);
+ statusr_until();
+ setState(536);
+ match(DEDENT);
+ setState(537);
+ match(DEDENT);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Statusr_allowContext extends ParserRuleContext {
+ public TerminalNode ALLOW() { return getToken(AuthnFlowParser.ALLOW, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public TerminalNode SECS() { return getToken(AuthnFlowParser.SECS, 0); }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public VariableContext variable() {
+ return getRuleContext(VariableContext.class,0);
+ }
+ public TerminalNode UINT() { return getToken(AuthnFlowParser.UINT, 0); }
+ public Statusr_allowContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_statusr_allow; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatusr_allow(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatusr_allow(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatusr_allow(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Statusr_allowContext statusr_allow() throws RecognitionException {
+ Statusr_allowContext _localctx = new Statusr_allowContext(_ctx, getState());
+ enterRule(_localctx, 76, RULE_statusr_allow);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(539);
+ match(ALLOW);
+ setState(540);
+ match(WS);
+ setState(543);
+ _errHandler.sync(this);
+ switch (_input.LA(1)) {
+ case ALPHANUM:
+ case QNAME:
+ case DOTEXPR:
+ case DOTIDXEXPR:
+ {
+ setState(541);
+ variable();
+ }
+ break;
+ case UINT:
+ {
+ setState(542);
+ match(UINT);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(545);
+ match(WS);
+ setState(546);
+ match(SECS);
+ setState(548);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(547);
+ match(WS);
+ }
+ }
+
+ setState(550);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Statusr_replyContext extends ParserRuleContext {
+ public TerminalNode REPLY() { return getToken(AuthnFlowParser.REPLY, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public Static_callContext static_call() {
+ return getRuleContext(Static_callContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public Statusr_replyContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_statusr_reply; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatusr_reply(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatusr_reply(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatusr_reply(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Statusr_replyContext statusr_reply() throws RecognitionException {
+ Statusr_replyContext _localctx = new Statusr_replyContext(_ctx, getState());
+ enterRule(_localctx, 78, RULE_statusr_reply);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(552);
+ match(REPLY);
+ setState(553);
+ match(WS);
+ setState(554);
+ static_call();
+ setState(556);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(555);
+ match(WS);
+ }
+ }
+
+ setState(558);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class Statusr_untilContext extends ParserRuleContext {
+ public TerminalNode UNTIL() { return getToken(AuthnFlowParser.UNTIL, 0); }
+ public List WS() { return getTokens(AuthnFlowParser.WS); }
+ public TerminalNode WS(int i) {
+ return getToken(AuthnFlowParser.WS, i);
+ }
+ public Boolean_exprContext boolean_expr() {
+ return getRuleContext(Boolean_exprContext.class,0);
+ }
+ public TerminalNode NL() { return getToken(AuthnFlowParser.NL, 0); }
+ public Statusr_untilContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_statusr_until; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).enterStatusr_until(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof AuthnFlowListener ) ((AuthnFlowListener)listener).exitStatusr_until(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof AuthnFlowVisitor ) return ((AuthnFlowVisitor extends T>)visitor).visitStatusr_until(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final Statusr_untilContext statusr_until() throws RecognitionException {
+ Statusr_untilContext _localctx = new Statusr_untilContext(_ctx, getState());
+ enterRule(_localctx, 80, RULE_statusr_until);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(560);
+ match(UNTIL);
+ setState(561);
+ match(WS);
+ setState(562);
+ boolean_expr();
+ setState(564);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ if (_la==WS) {
+ {
+ setState(563);
+ match(WS);
+ }
+ }
+
+ setState(566);
+ match(NL);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static final String _serializedATN =
+ "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\39\u023b\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*\3\2\3\2"+
+ "\6\2W\n\2\r\2\16\2X\3\3\3\3\3\3\3\3\5\3_\n\3\3\3\3\3\3\3\5\3d\n\3\3\3"+
+ "\3\3\7\3h\n\3\f\3\16\3k\13\3\3\4\3\4\3\5\3\5\3\5\3\5\5\5s\n\5\3\5\3\5"+
+ "\3\6\3\6\3\6\6\6z\n\6\r\6\16\6{\3\6\5\6\177\n\6\3\6\3\6\3\7\3\7\3\b\3"+
+ "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u0090\n\b\3\t\3\t\5\t\u0094"+
+ "\n\t\3\t\3\t\5\t\u0098\n\t\3\n\5\n\u009b\n\n\3\n\5\n\u009e\n\n\3\n\3\n"+
+ "\5\n\u00a2\n\n\3\n\3\n\5\n\u00a6\n\n\3\n\3\n\5\n\u00aa\n\n\3\13\3\13\3"+
+ "\13\3\13\5\13\u00b0\n\13\3\f\5\f\u00b3\n\f\3\f\3\f\3\f\3\f\3\f\5\f\u00ba"+
+ "\n\f\3\f\7\f\u00bd\n\f\f\f\16\f\u00c0\13\f\3\f\5\f\u00c3\n\f\3\f\3\f\5"+
+ "\f\u00c7\n\f\3\r\3\r\3\r\3\r\3\r\3\r\7\r\u00cf\n\r\f\r\16\r\u00d2\13\r"+
+ "\3\r\5\r\u00d5\n\r\3\r\3\r\3\r\3\16\3\16\5\16\u00dc\n\16\3\16\3\16\3\16"+
+ "\3\16\5\16\u00e2\n\16\3\16\5\16\u00e5\n\16\3\16\3\16\3\17\5\17\u00ea\n"+
+ "\17\3\17\3\17\3\17\3\17\3\17\5\17\u00f1\n\17\3\17\3\17\5\17\u00f5\n\17"+
+ "\3\17\5\17\u00f8\n\17\3\17\3\17\5\17\u00fc\n\17\3\20\3\20\6\20\u0100\n"+
+ "\20\r\20\16\20\u0101\3\20\5\20\u0105\n\20\3\20\3\20\3\21\3\21\3\21\3\21"+
+ "\7\21\u010d\n\21\f\21\16\21\u0110\13\21\3\22\3\22\3\22\3\22\7\22\u0116"+
+ "\n\22\f\22\16\22\u0119\13\22\3\23\3\23\3\23\3\24\3\24\3\24\3\24\5\24\u0122"+
+ "\n\24\3\25\3\25\3\26\3\26\3\26\5\26\u0129\n\26\3\27\3\27\5\27\u012d\n"+
+ "\27\3\27\7\27\u0130\n\27\f\27\16\27\u0133\13\27\3\27\3\27\7\27\u0137\n"+
+ "\27\f\27\16\27\u013a\13\27\3\27\5\27\u013d\n\27\3\27\3\27\3\30\3\30\5"+
+ "\30\u0143\n\30\3\30\7\30\u0146\n\30\f\30\16\30\u0149\13\30\3\30\3\30\7"+
+ "\30\u014d\n\30\f\30\16\30\u0150\13\30\3\30\5\30\u0153\n\30\3\30\3\30\3"+
+ "\31\3\31\3\31\5\31\u015a\n\31\3\31\3\31\3\32\3\32\5\32\u0160\n\32\3\32"+
+ "\3\32\5\32\u0164\n\32\3\32\3\32\3\33\5\33\u0169\n\33\3\33\3\33\3\33\3"+
+ "\33\5\33\u016f\n\33\3\33\3\33\3\34\3\34\3\34\3\34\5\34\u0177\n\34\3\34"+
+ "\5\34\u017a\n\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u0184\n"+
+ "\35\3\35\3\35\6\35\u0188\n\35\r\35\16\35\u0189\3\35\3\35\5\35\u018e\n"+
+ "\35\3\36\3\36\5\36\u0192\n\36\3\36\3\36\6\36\u0196\n\36\r\36\16\36\u0197"+
+ "\3\36\3\36\3\37\3\37\3\37\6\37\u019f\n\37\r\37\16\37\u01a0\3\37\3\37\5"+
+ "\37\u01a5\n\37\3 \3 \3 \3 \7 \u01ab\n \f \16 \u01ae\13 \3!\7!\u01b1\n"+
+ "!\f!\16!\u01b4\13!\3!\3!\5!\u01b8\n!\3!\7!\u01bb\n!\f!\16!\u01be\13!\3"+
+ "!\3!\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u01c8\n\"\3\"\3\"\5\"\u01cc\n\"\3#\3"+
+ "#\5#\u01d0\n#\3#\3#\6#\u01d4\n#\r#\16#\u01d5\3#\3#\3$\5$\u01db\n$\3$\3"+
+ "$\3$\3$\3$\3$\3$\3$\3$\6$\u01e6\n$\r$\16$\u01e7\3$\5$\u01eb\n$\3$\3$\3"+
+ "%\5%\u01f0\n%\3%\3%\3%\3%\5%\u01f6\n%\3%\3%\3%\5%\u01fb\n%\3%\3%\6%\u01ff"+
+ "\n%\r%\16%\u0200\3%\5%\u0204\n%\3%\3%\3&\3&\3&\3&\3&\7&\u020d\n&\f&\16"+
+ "&\u0210\13&\3\'\3\'\3\'\5\'\u0215\n\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3"+
+ "(\3(\3(\5(\u0222\n(\3(\3(\3(\5(\u0227\n(\3(\3(\3)\3)\3)\3)\5)\u022f\n"+
+ ")\3)\3)\3*\3*\3*\3*\5*\u0237\n*\3*\3*\3*\2\2+\2\4\6\b\n\f\16\20\22\24"+
+ "\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPR\2\5\3\2\61\62\3\2+"+
+ "\60\3\2#$\2\u0270\2T\3\2\2\2\4Z\3\2\2\2\6l\3\2\2\2\bn\3\2\2\2\nv\3\2\2"+
+ "\2\f\u0082\3\2\2\2\16\u008f\3\2\2\2\20\u0091\3\2\2\2\22\u009a\3\2\2\2"+
+ "\24\u00af\3\2\2\2\26\u00b2\3\2\2\2\30\u00c8\3\2\2\2\32\u00db\3\2\2\2\34"+
+ "\u00e9\3\2\2\2\36\u00fd\3\2\2\2 \u0108\3\2\2\2\"\u0111\3\2\2\2$\u011a"+
+ "\3\2\2\2&\u0121\3\2\2\2(\u0123\3\2\2\2*\u0128\3\2\2\2,\u012a\3\2\2\2."+
+ "\u0140\3\2\2\2\60\u0156\3\2\2\2\62\u015d\3\2\2\2\64\u0168\3\2\2\2\66\u0172"+
+ "\3\2\2\28\u017d\3\2\2\2:\u018f\3\2\2\2<\u019b\3\2\2\2>\u01a6\3\2\2\2@"+
+ "\u01b2\3\2\2\2B\u01c1\3\2\2\2D\u01cd\3\2\2\2F\u01da\3\2\2\2H\u01ef\3\2"+
+ "\2\2J\u0207\3\2\2\2L\u0211\3\2\2\2N\u021d\3\2\2\2P\u022a\3\2\2\2R\u0232"+
+ "\3\2\2\2TV\5\4\3\2UW\5\16\b\2VU\3\2\2\2WX\3\2\2\2XV\3\2\2\2XY\3\2\2\2"+
+ "Y\3\3\2\2\2Z[\7\r\2\2[\\\7\67\2\2\\^\5\6\4\2]_\7\67\2\2^]\3\2\2\2^_\3"+
+ "\2\2\2_`\3\2\2\2`a\78\2\2ac\5\b\5\2bd\5\n\6\2cb\3\2\2\2cd\3\2\2\2de\3"+
+ "\2\2\2ei\79\2\2fh\7\13\2\2gf\3\2\2\2hk\3\2\2\2ig\3\2\2\2ij\3\2\2\2j\5"+
+ "\3\2\2\2ki\3\2\2\2lm\t\2\2\2m\7\3\2\2\2no\7\16\2\2op\7\67\2\2pr\7-\2\2"+
+ "qs\7\67\2\2rq\3\2\2\2rs\3\2\2\2st\3\2\2\2tu\7\13\2\2u\t\3\2\2\2vy\7\17"+
+ "\2\2wx\7\67\2\2xz\5\f\7\2yw\3\2\2\2z{\3\2\2\2{y\3\2\2\2{|\3\2\2\2|~\3"+
+ "\2\2\2}\177\7\67\2\2~}\3\2\2\2~\177\3\2\2\2\177\u0080\3\2\2\2\u0080\u0081"+
+ "\7\13\2\2\u0081\13\3\2\2\2\u0082\u0083\7\61\2\2\u0083\r\3\2\2\2\u0084"+
+ "\u0090\5\26\f\2\u0085\u0090\5\32\16\2\u0086\u0090\5\34\17\2\u0087\u0090"+
+ "\5\60\31\2\u0088\u0090\5\36\20\2\u0089\u0090\5\64\33\2\u008a\u0090\5\66"+
+ "\34\2\u008b\u0090\5<\37\2\u008c\u0090\58\35\2\u008d\u0090\5F$\2\u008e"+
+ "\u0090\5H%\2\u008f\u0084\3\2\2\2\u008f\u0085\3\2\2\2\u008f\u0086\3\2\2"+
+ "\2\u008f\u0087\3\2\2\2\u008f\u0088\3\2\2\2\u008f\u0089\3\2\2\2\u008f\u008a"+
+ "\3\2\2\2\u008f\u008b\3\2\2\2\u008f\u008c\3\2\2\2\u008f\u008d\3\2\2\2\u008f"+
+ "\u008e\3\2\2\2\u0090\17\3\2\2\2\u0091\u0093\5\24\13\2\u0092\u0094\7\67"+
+ "\2\2\u0093\u0092\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0095\3\2\2\2\u0095"+
+ "\u0097\7)\2\2\u0096\u0098\7\67\2\2\u0097\u0096\3\2\2\2\u0097\u0098\3\2"+
+ "\2\2\u0098\21\3\2\2\2\u0099\u009b\5\24\13\2\u009a\u0099\3\2\2\2\u009a"+
+ "\u009b\3\2\2\2\u009b\u009d\3\2\2\2\u009c\u009e\7\67\2\2\u009d\u009c\3"+
+ "\2\2\2\u009d\u009e\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a1\7\3\2\2\u00a0"+
+ "\u00a2\7\67\2\2\u00a1\u00a0\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a3\3"+
+ "\2\2\2\u00a3\u00a5\5\f\7\2\u00a4\u00a6\7\67\2\2\u00a5\u00a4\3\2\2\2\u00a5"+
+ "\u00a6\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a9\7)\2\2\u00a8\u00aa\7\67"+
+ "\2\2\u00a9\u00a8\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\23\3\2\2\2\u00ab\u00b0"+
+ "\5\f\7\2\u00ac\u00b0\7\62\2\2\u00ad\u00b0\7\64\2\2\u00ae\u00b0\7\65\2"+
+ "\2\u00af\u00ab\3\2\2\2\u00af\u00ac\3\2\2\2\u00af\u00ad\3\2\2\2\u00af\u00ae"+
+ "\3\2\2\2\u00b0\25\3\2\2\2\u00b1\u00b3\5\20\t\2\u00b2\u00b1\3\2\2\2\u00b2"+
+ "\u00b3\3\2\2\2\u00b3\u00b4\3\2\2\2\u00b4\u00b5\7\21\2\2\u00b5\u00b9\7"+
+ "\67\2\2\u00b6\u00b7\7\4\2\2\u00b7\u00ba\5\24\13\2\u00b8\u00ba\5\6\4\2"+
+ "\u00b9\u00b6\3\2\2\2\u00b9\u00b8\3\2\2\2\u00ba\u00be\3\2\2\2\u00bb\u00bd"+
+ "\5$\23\2\u00bc\u00bb\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be\u00bc\3\2\2\2\u00be"+
+ "\u00bf\3\2\2\2\u00bf\u00c2\3\2\2\2\u00c0\u00be\3\2\2\2\u00c1\u00c3\7\67"+
+ "\2\2\u00c2\u00c1\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00c6\3\2\2\2\u00c4"+
+ "\u00c7\5\30\r\2\u00c5\u00c7\7\13\2\2\u00c6\u00c4\3\2\2\2\u00c6\u00c5\3"+
+ "\2\2\2\u00c7\27\3\2\2\2\u00c8\u00c9\78\2\2\u00c9\u00ca\7\30\2\2\u00ca"+
+ "\u00cb\7\67\2\2\u00cb\u00d0\7-\2\2\u00cc\u00cd\7\67\2\2\u00cd\u00cf\7"+
+ "-\2\2\u00ce\u00cc\3\2\2\2\u00cf\u00d2\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d0"+
+ "\u00d1\3\2\2\2\u00d1\u00d4\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d5\7\67"+
+ "\2\2\u00d4\u00d3\3\2\2\2\u00d4\u00d5\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6"+
+ "\u00d7\7\13\2\2\u00d7\u00d8\79\2\2\u00d8\31\3\2\2\2\u00d9\u00dc\5\20\t"+
+ "\2\u00da\u00dc\5\22\n\2\u00db\u00d9\3\2\2\2\u00db\u00da\3\2\2\2\u00db"+
+ "\u00dc\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\u00de\7\22\2\2\u00de\u00e1\7"+
+ "\67\2\2\u00df\u00e2\5 \21\2\u00e0\u00e2\5\"\22\2\u00e1\u00df\3\2\2\2\u00e1"+
+ "\u00e0\3\2\2\2\u00e2\u00e4\3\2\2\2\u00e3\u00e5\7\67\2\2\u00e4\u00e3\3"+
+ "\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e6\3\2\2\2\u00e6\u00e7\7\13\2\2\u00e7"+
+ "\33\3\2\2\2\u00e8\u00ea\5\20\t\2\u00e9\u00e8\3\2\2\2\u00e9\u00ea\3\2\2"+
+ "\2\u00ea\u00eb\3\2\2\2\u00eb\u00ec\7\23\2\2\u00ec\u00ed\7\67\2\2\u00ed"+
+ "\u00f0\7-\2\2\u00ee\u00ef\7\67\2\2\u00ef\u00f1\5\24\13\2\u00f0\u00ee\3"+
+ "\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f4\3\2\2\2\u00f2\u00f3\7\67\2\2\u00f3"+
+ "\u00f5\7,\2\2\u00f4\u00f2\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f7\3\2"+
+ "\2\2\u00f6\u00f8\7\67\2\2\u00f7\u00f6\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8"+
+ "\u00fb\3\2\2\2\u00f9\u00fc\5L\'\2\u00fa\u00fc\7\13\2\2\u00fb\u00f9\3\2"+
+ "\2\2\u00fb\u00fa\3\2\2\2\u00fc\35\3\2\2\2\u00fd\u00ff\7\20\2\2\u00fe\u0100"+
+ "\5$\23\2\u00ff\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u00ff\3\2\2\2\u0101"+
+ "\u0102\3\2\2\2\u0102\u0104\3\2\2\2\u0103\u0105\7\67\2\2\u0104\u0103\3"+
+ "\2\2\2\u0104\u0105\3\2\2\2\u0105\u0106\3\2\2\2\u0106\u0107\7\13\2\2\u0107"+
+ "\37\3\2\2\2\u0108\u0109\5\6\4\2\u0109\u010a\7\5\2\2\u010a\u010e\7\61\2"+
+ "\2\u010b\u010d\5$\23\2\u010c\u010b\3\2\2\2\u010d\u0110\3\2\2\2\u010e\u010c"+
+ "\3\2\2\2\u010e\u010f\3\2\2\2\u010f!\3\2\2\2\u0110\u010e\3\2\2\2\u0111"+
+ "\u0112\5\24\13\2\u0112\u0113\7\67\2\2\u0113\u0117\7\61\2\2\u0114\u0116"+
+ "\5$\23\2\u0115\u0114\3\2\2\2\u0116\u0119\3\2\2\2\u0117\u0115\3\2\2\2\u0117"+
+ "\u0118\3\2\2\2\u0118#\3\2\2\2\u0119\u0117\3\2\2\2\u011a\u011b\7\67\2\2"+
+ "\u011b\u011c\5&\24\2\u011c%\3\2\2\2\u011d\u0122\5(\25\2\u011e\u0122\5"+
+ "\24\13\2\u011f\u0120\7*\2\2\u0120\u0122\5\24\13\2\u0121\u011d\3\2\2\2"+
+ "\u0121\u011e\3\2\2\2\u0121\u011f\3\2\2\2\u0122\'\3\2\2\2\u0123\u0124\t"+
+ "\3\2\2\u0124)\3\2\2\2\u0125\u0129\5.\30\2\u0126\u0129\5,\27\2\u0127\u0129"+
+ "\5&\24\2\u0128\u0125\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0127\3\2\2\2\u0129"+
+ "+\3\2\2\2\u012a\u012c\7\6\2\2\u012b\u012d\7\67\2\2\u012c\u012b\3\2\2\2"+
+ "\u012c\u012d\3\2\2\2\u012d\u0131\3\2\2\2\u012e\u0130\5*\26\2\u012f\u012e"+
+ "\3\2\2\2\u0130\u0133\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2\u0132"+
+ "\u0138\3\2\2\2\u0133\u0131\3\2\2\2\u0134\u0135\7\66\2\2\u0135\u0137\5"+
+ "*\26\2\u0136\u0134\3\2\2\2\u0137\u013a\3\2\2\2\u0138\u0136\3\2\2\2\u0138"+
+ "\u0139\3\2\2\2\u0139\u013c\3\2\2\2\u013a\u0138\3\2\2\2\u013b\u013d\7\67"+
+ "\2\2\u013c\u013b\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u013e\3\2\2\2\u013e"+
+ "\u013f\7\7\2\2\u013f-\3\2\2\2\u0140\u0142\7\b\2\2\u0141\u0143\7\67\2\2"+
+ "\u0142\u0141\3\2\2\2\u0142\u0143\3\2\2\2\u0143\u0147\3\2\2\2\u0144\u0146"+
+ "\5\62\32\2\u0145\u0144\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0145\3\2\2\2"+
+ "\u0147\u0148\3\2\2\2\u0148\u014e\3\2\2\2\u0149\u0147\3\2\2\2\u014a\u014b"+
+ "\7\66\2\2\u014b\u014d\5\62\32\2\u014c\u014a\3\2\2\2\u014d\u0150\3\2\2"+
+ "\2\u014e\u014c\3\2\2\2\u014e\u014f\3\2\2\2\u014f\u0152\3\2\2\2\u0150\u014e"+
+ "\3\2\2\2\u0151\u0153\7\67\2\2\u0152\u0151\3\2\2\2\u0152\u0153\3\2\2\2"+
+ "\u0153\u0154\3\2\2\2\u0154\u0155\7\t\2\2\u0155/\3\2\2\2\u0156\u0157\5"+
+ "\20\t\2\u0157\u0159\5*\26\2\u0158\u015a\7\67\2\2\u0159\u0158\3\2\2\2\u0159"+
+ "\u015a\3\2\2\2\u015a\u015b\3\2\2\2\u015b\u015c\7\13\2\2\u015c\61\3\2\2"+
+ "\2\u015d\u015f\7\61\2\2\u015e\u0160\7\67\2\2\u015f\u015e\3\2\2\2\u015f"+
+ "\u0160\3\2\2\2\u0160\u0161\3\2\2\2\u0161\u0163\7\n\2\2\u0162\u0164\7\67"+
+ "\2\2\u0163\u0162\3\2\2\2\u0163\u0164\3\2\2\2\u0164\u0165\3\2\2\2\u0165"+
+ "\u0166\5*\26\2\u0166\63\3\2\2\2\u0167\u0169\5\20\t\2\u0168\u0167\3\2\2"+
+ "\2\u0168\u0169\3\2\2\2\u0169\u016a\3\2\2\2\u016a\u016b\7 \2\2\u016b\u016e"+
+ "\7\67\2\2\u016c\u016f\7-\2\2\u016d\u016f\5\24\13\2\u016e\u016c\3\2\2\2"+
+ "\u016e\u016d\3\2\2\2\u016f\u0170\3\2\2\2\u0170\u0171\7\13\2\2\u0171\65"+
+ "\3\2\2\2\u0172\u0173\7\37\2\2\u0173\u0176\7\67\2\2\u0174\u0177\7,\2\2"+
+ "\u0175\u0177\5\24\13\2\u0176\u0174\3\2\2\2\u0176\u0175\3\2\2\2\u0177\u0179"+
+ "\3\2\2\2\u0178\u017a\7\67\2\2\u0179\u0178\3\2\2\2\u0179\u017a\3\2\2\2"+
+ "\u017a\u017b\3\2\2\2\u017b\u017c\7\13\2\2\u017c\67\3\2\2\2\u017d\u017e"+
+ "\7\35\2\2\u017e\u017f\7\67\2\2\u017f\u0180\5&\24\2\u0180\u0181\7\67\2"+
+ "\2\u0181\u0183\7&\2\2\u0182\u0184\7\67\2\2\u0183\u0182\3\2\2\2\u0183\u0184"+
+ "\3\2\2\2\u0184\u0185\3\2\2\2\u0185\u0187\78\2\2\u0186\u0188\5:\36\2\u0187"+
+ "\u0186\3\2\2\2\u0188\u0189\3\2\2\2\u0189\u0187\3\2\2\2\u0189\u018a\3\2"+
+ "\2\2\u018a\u018b\3\2\2\2\u018b\u018d\79\2\2\u018c\u018e\5D#\2\u018d\u018c"+
+ "\3\2\2\2\u018d\u018e\3\2\2\2\u018e9\3\2\2\2\u018f\u0191\5&\24\2\u0190"+
+ "\u0192\7\67\2\2\u0191\u0190\3\2\2\2\u0191\u0192\3\2\2\2\u0192\u0193\3"+
+ "\2\2\2\u0193\u0195\78\2\2\u0194\u0196\5\16\b\2\u0195\u0194\3\2\2\2\u0196"+
+ "\u0197\3\2\2\2\u0197\u0195\3\2\2\2\u0197\u0198\3\2\2\2\u0198\u0199\3\2"+
+ "\2\2\u0199\u019a\79\2\2\u019a;\3\2\2\2\u019b\u019c\5> \2\u019c\u019e\7"+
+ "8\2\2\u019d\u019f\5\16\b\2\u019e\u019d\3\2\2\2\u019f\u01a0\3\2\2\2\u01a0"+
+ "\u019e\3\2\2\2\u01a0\u01a1\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\u01a4\79"+
+ "\2\2\u01a3\u01a5\5D#\2\u01a4\u01a3\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5="+
+ "\3\2\2\2\u01a6\u01a7\7\31\2\2\u01a7\u01a8\7\67\2\2\u01a8\u01ac\5B\"\2"+
+ "\u01a9\u01ab\5@!\2\u01aa\u01a9\3\2\2\2\u01ab\u01ae\3\2\2\2\u01ac\u01aa"+
+ "\3\2\2\2\u01ac\u01ad\3\2\2\2\u01ad?\3\2\2\2\u01ae\u01ac\3\2\2\2\u01af"+
+ "\u01b1\7\13\2\2\u01b0\u01af\3\2\2\2\u01b1\u01b4\3\2\2\2\u01b2\u01b0\3"+
+ "\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b5\3\2\2\2\u01b4\u01b2\3\2\2\2\u01b5"+
+ "\u01b7\t\4\2\2\u01b6\u01b8\7\67\2\2\u01b7\u01b6\3\2\2\2\u01b7\u01b8\3"+
+ "\2\2\2\u01b8\u01bc\3\2\2\2\u01b9\u01bb\7\13\2\2\u01ba\u01b9\3\2\2\2\u01bb"+
+ "\u01be\3\2\2\2\u01bc\u01ba\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01bf\3\2"+
+ "\2\2\u01be\u01bc\3\2\2\2\u01bf\u01c0\5B\"\2\u01c0A\3\2\2\2\u01c1\u01c2"+
+ "\5&\24\2\u01c2\u01c3\7\67\2\2\u01c3\u01c4\7!\2\2\u01c4\u01c7\7\67\2\2"+
+ "\u01c5\u01c6\7\"\2\2\u01c6\u01c8\7\67\2\2\u01c7\u01c5\3\2\2\2\u01c7\u01c8"+
+ "\3\2\2\2\u01c8\u01c9\3\2\2\2\u01c9\u01cb\5&\24\2\u01ca\u01cc\7\67\2\2"+
+ "\u01cb\u01ca\3\2\2\2\u01cb\u01cc\3\2\2\2\u01ccC\3\2\2\2\u01cd\u01cf\7"+
+ "\32\2\2\u01ce\u01d0\7\67\2\2\u01cf\u01ce\3\2\2\2\u01cf\u01d0\3\2\2\2\u01d0"+
+ "\u01d1\3\2\2\2\u01d1\u01d3\78\2\2\u01d2\u01d4\5\16\b\2\u01d3\u01d2\3\2"+
+ "\2\2\u01d4\u01d5\3\2\2\2\u01d5\u01d3\3\2\2\2\u01d5\u01d6\3\2\2\2\u01d6"+
+ "\u01d7\3\2\2\2\u01d7\u01d8\79\2\2\u01d8E\3\2\2\2\u01d9\u01db\5\20\t\2"+
+ "\u01da\u01d9\3\2\2\2\u01da\u01db\3\2\2\2\u01db\u01dc\3\2\2\2\u01dc\u01dd"+
+ "\7\34\2\2\u01dd\u01de\7\67\2\2\u01de\u01df\5\24\13\2\u01df\u01e0\7\67"+
+ "\2\2\u01e0\u01e1\7(\2\2\u01e1\u01e2\7\67\2\2\u01e2\u01e3\5\f\7\2\u01e3"+
+ "\u01e5\78\2\2\u01e4\u01e6\5\16\b\2\u01e5\u01e4\3\2\2\2\u01e6\u01e7\3\2"+
+ "\2\2\u01e7\u01e5\3\2\2\2\u01e7\u01e8\3\2\2\2\u01e8\u01ea\3\2\2\2\u01e9"+
+ "\u01eb\5J&\2\u01ea\u01e9\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb\u01ec\3\2\2"+
+ "\2\u01ec\u01ed\79\2\2\u01edG\3\2\2\2\u01ee\u01f0\5\20\t\2\u01ef\u01ee"+
+ "\3\2\2\2\u01ef\u01f0\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1\u01f2\7\33\2\2"+
+ "\u01f2\u01f5\7\67\2\2\u01f3\u01f6\5\24\13\2\u01f4\u01f6\7.\2\2\u01f5\u01f3"+
+ "\3\2\2\2\u01f5\u01f4\3\2\2\2\u01f6\u01f7\3\2\2\2\u01f7\u01f8\7\67\2\2"+
+ "\u01f8\u01fa\7\'\2\2\u01f9\u01fb\7\67\2\2\u01fa\u01f9\3\2\2\2\u01fa\u01fb"+
+ "\3\2\2\2\u01fb\u01fc\3\2\2\2\u01fc\u01fe\78\2\2\u01fd\u01ff\5\16\b\2\u01fe"+
+ "\u01fd\3\2\2\2\u01ff\u0200\3\2\2\2\u0200\u01fe\3\2\2\2\u0200\u0201\3\2"+
+ "\2\2\u0201\u0203\3\2\2\2\u0202\u0204\5J&\2\u0203\u0202\3\2\2\2\u0203\u0204"+
+ "\3\2\2\2\u0204\u0205\3\2\2\2\u0205\u0206\79\2\2\u0206I\3\2\2\2\u0207\u0208"+
+ "\7\36\2\2\u0208\u0209\7\67\2\2\u0209\u020a\5> \2\u020a\u020e\7\13\2\2"+
+ "\u020b\u020d\5\16\b\2\u020c\u020b\3\2\2\2\u020d\u0210\3\2\2\2\u020e\u020c"+
+ "\3\2\2\2\u020e\u020f\3\2\2\2\u020fK\3\2\2\2\u0210\u020e\3\2\2\2\u0211"+
+ "\u0212\78\2\2\u0212\u0214\7\24\2\2\u0213\u0215\7\67\2\2\u0214\u0213\3"+
+ "\2\2\2\u0214\u0215\3\2\2\2\u0215\u0216\3\2\2\2\u0216\u0217\78\2\2\u0217"+
+ "\u0218\5N(\2\u0218\u0219\5P)\2\u0219\u021a\5R*\2\u021a\u021b\79\2\2\u021b"+
+ "\u021c\79\2\2\u021cM\3\2\2\2\u021d\u021e\7\25\2\2\u021e\u0221\7\67\2\2"+
+ "\u021f\u0222\5\24\13\2\u0220\u0222\7.\2\2\u0221\u021f\3\2\2\2\u0221\u0220"+
+ "\3\2\2\2\u0222\u0223\3\2\2\2\u0223\u0224\7\67\2\2\u0224\u0226\7%\2\2\u0225"+
+ "\u0227\7\67\2\2\u0226\u0225\3\2\2\2\u0226\u0227\3\2\2\2\u0227\u0228\3"+
+ "\2\2\2\u0228\u0229\7\13\2\2\u0229O\3\2\2\2\u022a\u022b\7\26\2\2\u022b"+
+ "\u022c\7\67\2\2\u022c\u022e\5 \21\2\u022d\u022f\7\67\2\2\u022e\u022d\3"+
+ "\2\2\2\u022e\u022f\3\2\2\2\u022f\u0230\3\2\2\2\u0230\u0231\7\13\2\2\u0231"+
+ "Q\3\2\2\2\u0232\u0233\7\27\2\2\u0233\u0234\7\67\2\2\u0234\u0236\5B\"\2"+
+ "\u0235\u0237\7\67\2\2\u0236\u0235\3\2\2\2\u0236\u0237\3\2\2\2\u0237\u0238"+
+ "\3\2\2\2\u0238\u0239\7\13\2\2\u0239S\3\2\2\2SX^cir{~\u008f\u0093\u0097"+
+ "\u009a\u009d\u00a1\u00a5\u00a9\u00af\u00b2\u00b9\u00be\u00c2\u00c6\u00d0"+
+ "\u00d4\u00db\u00e1\u00e4\u00e9\u00f0\u00f4\u00f7\u00fb\u0101\u0104\u010e"+
+ "\u0117\u0121\u0128\u012c\u0131\u0138\u013c\u0142\u0147\u014e\u0152\u0159"+
+ "\u015f\u0163\u0168\u016e\u0176\u0179\u0183\u0189\u018d\u0191\u0197\u01a0"+
+ "\u01a4\u01ac\u01b2\u01b7\u01bc\u01c7\u01cb\u01cf\u01d5\u01da\u01e7\u01ea"+
+ "\u01ef\u01f5\u01fa\u0200\u0203\u020e\u0214\u0221\u0226\u022e\u0236";
+ 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/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowVisitor.java b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowVisitor.java
new file mode 100644
index 00000000000..38b9c5c7424
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/antlr/AuthnFlowVisitor.java
@@ -0,0 +1,259 @@
+// Generated from AuthnFlow.g4 by ANTLR 4.9.2
+package io.jans.agama.antlr;
+import org.antlr.v4.runtime.tree.ParseTreeVisitor;
+
+/**
+ * This interface defines a complete generic visitor for a parse tree produced
+ * by {@link AuthnFlowParser}.
+ *
+ * @param The return type of the visit operation. Use {@link Void} for
+ * operations with no return type.
+ */
+public interface AuthnFlowVisitor extends ParseTreeVisitor {
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#flow}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitFlow(AuthnFlowParser.FlowContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#header}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitHeader(AuthnFlowParser.HeaderContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#qname}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitQname(AuthnFlowParser.QnameContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#base}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitBase(AuthnFlowParser.BaseContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#inputs}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitInputs(AuthnFlowParser.InputsContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#short_var}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitShort_var(AuthnFlowParser.Short_varContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#statement}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatement(AuthnFlowParser.StatementContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#preassign}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitPreassign(AuthnFlowParser.PreassignContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#preassign_catch}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitPreassign_catch(AuthnFlowParser.Preassign_catchContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#variable}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitVariable(AuthnFlowParser.VariableContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#flow_call}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitFlow_call(AuthnFlowParser.Flow_callContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#overrides}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitOverrides(AuthnFlowParser.OverridesContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#action_call}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitAction_call(AuthnFlowParser.Action_callContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#rrf_call}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitRrf_call(AuthnFlowParser.Rrf_callContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#log}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitLog(AuthnFlowParser.LogContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#static_call}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatic_call(AuthnFlowParser.Static_callContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#oo_call}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitOo_call(AuthnFlowParser.Oo_callContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#argument}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitArgument(AuthnFlowParser.ArgumentContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#simple_expr}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitSimple_expr(AuthnFlowParser.Simple_exprContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#literal}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitLiteral(AuthnFlowParser.LiteralContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#expression}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitExpression(AuthnFlowParser.ExpressionContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#array_expr}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitArray_expr(AuthnFlowParser.Array_exprContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#object_expr}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitObject_expr(AuthnFlowParser.Object_exprContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#assignment}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitAssignment(AuthnFlowParser.AssignmentContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#keypair}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitKeypair(AuthnFlowParser.KeypairContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#rfac}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitRfac(AuthnFlowParser.RfacContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#finish}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitFinish(AuthnFlowParser.FinishContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#choice}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitChoice(AuthnFlowParser.ChoiceContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#option}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitOption(AuthnFlowParser.OptionContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#ifelse}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitIfelse(AuthnFlowParser.IfelseContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#caseof}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitCaseof(AuthnFlowParser.CaseofContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#boolean_op_expr}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitBoolean_op_expr(AuthnFlowParser.Boolean_op_exprContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#boolean_expr}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitBoolean_expr(AuthnFlowParser.Boolean_exprContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#elseblock}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitElseblock(AuthnFlowParser.ElseblockContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#loop}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitLoop(AuthnFlowParser.LoopContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#loopy}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitLoopy(AuthnFlowParser.LoopyContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#quit_stmt}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitQuit_stmt(AuthnFlowParser.Quit_stmtContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#statusr_block}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatusr_block(AuthnFlowParser.Statusr_blockContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#statusr_allow}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatusr_allow(AuthnFlowParser.Statusr_allowContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#statusr_reply}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatusr_reply(AuthnFlowParser.Statusr_replyContext ctx);
+ /**
+ * Visit a parse tree produced by {@link AuthnFlowParser#statusr_until}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitStatusr_until(AuthnFlowParser.Statusr_untilContext ctx);
+}
\ No newline at end of file
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/Transpiler.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/Transpiler.java
new file mode 100644
index 00000000000..51fb66c96f3
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/Transpiler.java
@@ -0,0 +1,298 @@
+package io.jans.agama.dsl;
+
+import freemarker.ext.dom.NodeModel;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateExceptionHandler;
+
+import io.jans.agama.antlr.AuthnFlowLexer;
+import io.jans.agama.antlr.AuthnFlowParser;
+import io.jans.agama.dsl.error.SyntaxException;
+import io.jans.agama.dsl.error.RecognitionErrorListener;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import net.sf.saxon.dom.NodeOverNodeInfo;
+import net.sf.saxon.s9api.Processor;
+import net.sf.saxon.s9api.SaxonApiException;
+import net.sf.saxon.s9api.Serializer;
+import net.sf.saxon.s9api.XPathCompiler;
+import net.sf.saxon.s9api.XdmItem;
+import net.sf.saxon.s9api.XdmNode;
+import net.sf.saxon.sapling.SaplingDocument;
+
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.CharStreams;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Token;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+public class Transpiler {
+
+ private static final String FTL_LOCATION = "JSGenerator.ftl";
+
+ private Logger logger = LoggerFactory.getLogger(getClass());
+ private String flowId;
+ private Set flowNames;
+ private String fanny;
+
+ private Processor processor;
+ private XPathCompiler xpathCompiler;
+ private Template jsGenerator;
+
+ public Transpiler(String flowQName, Set flowQNames) throws TranspilerException {
+
+ if (flowQName == null) throw new TranspilerException("Qualified name cannot be null", new NullPointerException());
+
+ this.flowId = flowQName;
+ fanny = "_" + flowQName.replaceAll("\\.", "_"); //Generates a valid JS function name
+
+ if (flowQNames != null) {
+ flowNames = new HashSet(flowQNames);
+ flowNames.remove(flowQName);
+ }
+
+ processor = new Processor(false);
+ xpathCompiler = processor.newXPathCompiler();
+ xpathCompiler.setCaching(true);
+
+ loadFreeMarkerTemplate();
+
+ }
+
+ private String getFanny() {
+ return fanny;
+ }
+
+ private void loadFreeMarkerTemplate() throws TranspilerException {
+
+ try{
+ Configuration fmConfig = new Configuration(Configuration.VERSION_2_3_31);
+ fmConfig.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "/");
+ fmConfig.setDefaultEncoding(UTF_8.toString());
+ //TODO: ?
+ //fmConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
+ fmConfig.setTemplateExceptionHandler(TemplateExceptionHandler.DEBUG_HANDLER);
+ fmConfig.setLogTemplateExceptions(false);
+ fmConfig.setWrapUncheckedExceptions(true);
+ fmConfig.setFallbackOnNullLoopVariable(false);
+ jsGenerator = fmConfig.getTemplate(FTL_LOCATION);
+ } catch (Exception e) {
+ throw new TranspilerException("Template loading failed", e);
+ }
+
+ }
+
+ public SaplingDocument asXML(String DSLCode) throws SyntaxException, TranspilerException {
+
+ InputStream is = new ByteArrayInputStream(DSLCode.getBytes(UTF_8));
+ CharStream input = null;
+
+ try {
+ logger.debug("Creating ANTLR CharStream from DSL code");
+ //fromStream method closes the input stream upon returning
+ input = CharStreams.fromStream(is);
+ } catch (IOException ioe) {
+ throw new TranspilerException(ioe.getMessage(), ioe);
+ }
+
+ AuthnFlowLexer lexer = new AuthnFlowLexer(input);
+ RecognitionErrorListener lexerErrListener = new RecognitionErrorListener();
+ lexer.addErrorListener(lexerErrListener);
+ logger.debug("Lexer for grammar '{}' initialized", lexer.getGrammarFileName());
+
+ logger.debug("Creating parser");
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ AuthnFlowParser parser = new AuthnFlowParser(tokens);
+ RecognitionErrorListener parserErrListener = new RecognitionErrorListener();
+ parser.addErrorListener(parserErrListener);
+
+ try {
+ AuthnFlowParser.FlowContext flowContext = parser.flow();
+ SyntaxException syntaxException = Stream.of(lexerErrListener, parserErrListener)
+ .map(RecognitionErrorListener::getError).filter(Objects::nonNull)
+ .findFirst().orElse(null);
+
+ if (syntaxException != null) {
+ throw syntaxException;
+ } else if (!lexer._hitEOF) {
+ throw new SyntaxException("Unable to process the input code thoroughly",
+ lexer.getText(), lexer.getLine(), lexer.getCharPositionInLine());
+ }
+
+ logger.debug("Traversing parse tree");
+ //Generate XML representation
+
+ SaplingDocument document = Visitor.document(flowContext, AuthnFlowParser.RULE_flow, fanny);
+ applyValidations(document);
+ return document;
+
+ } catch (RecognitionException re) {
+ Token offender = re.getOffendingToken();
+ throw new SyntaxException(re.getMessage(), offender.getText(),
+ offender.getLine(), offender.getCharPositionInLine());
+ }
+
+ }
+
+ public List getInputs(SaplingDocument doc) throws SaxonApiException {
+
+ return xpathCompiler
+ .evaluate("/flow/header/inputs/short_var/text()", doc.toXdmNode(processor))
+ .stream().map(XdmItem::getStringValue).collect(Collectors.toList());
+
+ }
+
+ public String generateJS(SaplingDocument doc) throws TranspilerException {
+
+ try {
+ StringWriter sw = new StringWriter();
+ NodeModel model = asNodeModel(doc);
+
+ jsGenerator.process(model, sw);
+ return sw.toString();
+ } catch (IOException | TemplateException | SaxonApiException e) {
+ throw new TranspilerException("Transformation failed", e);
+ }
+
+ }
+
+ private void applyValidations(SaplingDocument doc) throws TranspilerException {
+
+ try {
+ XdmNode node = doc.toXdmNode(processor);
+
+ //Ensure only existing flows are referenced
+ checkUnknownInvocation(Visitor.FLOWCALL_XPATH_EXPR, flowNames, node);
+
+ } catch (SaxonApiException se) {
+ throw new TranspilerException("Validation failed", se);
+ }
+
+ }
+
+ private void checkUnknownInvocation(String xpathExpr, Set known, XdmNode node)
+ throws TranspilerException, SaxonApiException {
+
+ if (known != null) {
+ List invocations = xpathCompiler.evaluate(xpathExpr, node)
+ .stream().map(XdmItem::getStringValue).collect(Collectors.toList());
+
+ for (String t : invocations) {
+ if (t.equals(flowId))
+ throw new TranspilerException("A flow cannot trigger an instance of itself");
+
+ if (!known.contains(t))
+ throw new TranspilerException("Invocation of unknown element '" + t + "'");
+ }
+ }
+
+ }
+
+ private void logXml(SaplingDocument doc) {
+
+ try {
+ StringWriter sw = new StringWriter();
+ Serializer serializer = processor.newSerializer(sw);
+ serializer.setOutputProperty(Serializer.Property.INDENT, "true");
+
+ logger.debug("Serializing XML document");
+ doc.serialize(serializer);
+
+ logger.debug("\n{}", sw.toString());
+ } catch (SaxonApiException e) {
+ logger.error(e.getMessage(), e);
+ }
+
+ }
+
+ private NodeModel asNodeModel(SaplingDocument doc) throws SaxonApiException {
+ return NodeModel.wrap(NodeOverNodeInfo.wrap(
+ doc.toXdmNode(processor).getUnderlyingNode()));
+ }
+
+ private void generateFromXml(String fileName, OutputStream out) throws Exception {
+ NodeModel model = NodeModel.parse(Paths.get(fileName).toFile());
+ jsGenerator.process(model, new OutputStreamWriter(out, UTF_8));
+ }
+
+ /**
+ * Transpiles the input source code to code runnable by Agama flow engine in the
+ * form of a Javascript function
+ * @param flowQname Qualified name of the input flow
+ * @param flowQNames A list of known flow names. This is used to validate which flows can be
+ * triggered from the input flow (Trigger directive). Passing null disables the validation.
+ * Passing an empty list will make validation fail if any Trigger directive is found
+ * @param source Source code of input flow (written using Agama DSL)
+ * @return A (modifiable) list with at least 2 elements: 1st item contains the name of the function generated,
+ * 2nd item contents the actual function code. Remaining items, if any, correspond to the input
+ * parameter names the function has (as passed in the Input directive).
+ * @throws SyntaxException When the input source has syntactic errors, details are contained
+ * in the exception thrown
+ * @throws TranspilerException When other kind of processing error occurred.
+ */
+ public static List transpile(String flowQname, Set flowQNames, String source)
+ throws TranspilerException, SyntaxException {
+
+ List result = new ArrayList<>();
+ Transpiler tr = new Transpiler(flowQname, flowQNames);
+ SaplingDocument doc = tr.asXML(source);
+
+ result.add(tr.getFanny());
+ result.add(tr.generateJS(doc));
+ try {
+ result.addAll(tr.getInputs(doc));
+ } catch (SaxonApiException e) {
+ throw new TranspilerException(e.getMessage(), e);
+ }
+
+ return result;
+ }
+
+ public static void main(String... args) throws Exception {
+
+ Set knownFlows = null;
+ int len = args.length;
+
+ if (len < 2) {
+ System.err.println("Expecting at least 2 params: input file path and flow ID");
+ return;
+ } else if (len > 2) {
+
+ knownFlows = new HashSet<>();
+ for (int i = 3; i < len; i++) {
+ knownFlows.add(args[i]);
+ }
+ }
+
+ Transpiler tr = new Transpiler(args[1], knownFlows);
+ String dslCode = new String(Files.readAllBytes(Paths.get(args[0])), UTF_8);
+
+ SaplingDocument doc = tr.asXML(dslCode);
+ tr.logXml(doc);
+ System.out.println("\nInputs: " + tr.getInputs(doc));
+ System.out.println("\n" + tr.generateJS(doc));
+
+ //tr.generateFromXml("Sample.xml", System.out);
+ }
+
+}
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/TranspilerException.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/TranspilerException.java
new file mode 100644
index 00000000000..919a5efd638
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/TranspilerException.java
@@ -0,0 +1,13 @@
+package io.jans.agama.dsl;
+
+public class TranspilerException extends Exception {
+
+ public TranspilerException(String message) {
+ super(message);
+ }
+
+ public TranspilerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/VarsTransformer.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/VarsTransformer.java
new file mode 100644
index 00000000000..0f0a97979c4
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/VarsTransformer.java
@@ -0,0 +1,176 @@
+package io.jans.agama.dsl;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class VarsTransformer {
+
+ private static final String EVAL_SYMBOL = "$";
+ private static final Logger logger = LoggerFactory.getLogger(VarsTransformer.class);
+ private static final Set JS_KEYWORDS;
+
+ //See util.js
+ private static final String STRING_INDEX_FUNC = "_sc";
+ private static final String INT_INDEX_FUNC = "_ic";
+
+ static {
+ //The following cannot be used as variable names in DSL code
+ String[] javascriptKeywords = new String[] {
+ // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords
+ "break", "case", "catch", "class", "const", "continue",
+ "debugger", "default", "delete", "do", "else", "export", "extends",
+ "finally", "for", "function", "if", "import", "in", "instanceof", "new",
+ "return", "super", "switch", "this", "throw", "try", "typeof",
+ "var", "void", "while", "with", "yield",
+ "enum", "await", "let",
+
+ // Prevent arbitrary access to Java classes from script code, see
+ // http://web.archive.org/web/20210304081342/https://developer.mozilla.org/en-US/docs/Scripting_Java
+ "Packages",
+
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
+ // function names not included because they cannot be invoked from DSL code
+ // Control abstraction objects (except Promise), Reflection, Internationalization,
+ // and WebAssembly not yet supported in Rhino
+ "Infinity", "NaN", "undefined", "globalThis",
+ "Object", "Function", "Boolean", "Symbol",
+ "Error", "AggregateError", "EvalError", "InternalError", "RangeError",
+ "ReferenceError", "SyntaxError", "TypeError", "URIError",
+ "Number", "BigInt", "Math", "Date", "String", "RegExp",
+ "Array", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array",
+ "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array",
+ "Map", "Set", "WeakMap", "WeakSet",
+ "ArrayBuffer", "SharedArrayBuffer", "Atomics", "DataView", "JSON",
+ "Promise", "arguments"
+ };
+
+ JS_KEYWORDS = new HashSet(Arrays.asList(javascriptKeywords));
+
+ }
+
+ public static String correctedVariable(String variable) {
+
+ int dotIndex = variable.indexOf(".");
+ int rbIndex = variable.indexOf("[");
+ int index;
+
+ if (dotIndex != -1) {
+ if (rbIndex != -1) {
+ index = Math.min(dotIndex, rbIndex);
+ } else {
+ index = dotIndex;
+ }
+ } else {
+ index = rbIndex;
+ }
+
+ String identifier = index == -1 ? variable : variable.substring(0, index);
+ if (JS_KEYWORDS.contains(identifier)) {
+ logger.trace("Renaming variable {}", variable);
+ identifier = "_" + identifier;
+ }
+ return index == -1 ? identifier : identifier + variable.substring(index);
+
+ }
+
+ public static String convertToBracketNotation(String str) {
+ return processDotEvalAccessors(processStringAccessors(processExistingBrackets(str)));
+ }
+
+ private static String processDotEvalAccessors(String str) {
+
+ String subs;
+ StringBuilder sb = new StringBuilder();
+ int dot, brack, symlen = EVAL_SYMBOL.length();
+ int i, j = 0;
+
+ i = str.indexOf("." + EVAL_SYMBOL);
+ if (i == -1) return str;
+
+ do {
+ sb.append(str.substring(j, i));
+
+ dot = str.indexOf(".", i + 1 + symlen);
+ brack = str.indexOf("[", i + 1 + symlen);
+ if (dot == -1) {
+ if (brack == -1) {
+ j = str.length();
+ } else {
+ j = brack;
+ }
+ } else {
+ if (brack == -1) {
+ j = dot;
+ } else {
+ j = Math.min(dot, brack);
+ }
+ }
+
+ subs = str.substring(i + 1 + symlen, j);
+ sb.append(String.format("[%s(%s, \"%s\")]", STRING_INDEX_FUNC, subs, subs));
+ i = str.indexOf("." + EVAL_SYMBOL, j);
+ } while (i != -1);
+
+ sb.append(str.substring(j));
+ subs = sb.toString();
+ logger.trace("processDotEvalAccessors: {} converted to {}", str, subs);
+ return subs;
+
+ }
+
+ private static String processStringAccessors(String str) {
+
+ String subs;
+ StringBuilder sb = new StringBuilder();
+ int i, j = -1;
+
+ i = str.indexOf(".\"");
+ if (i == -1) return str;
+
+ do {
+ sb.append(str.substring(j + 1, i));
+ j = str.indexOf("\"", i + 2);
+ //j cannot be -1
+ subs = str.substring(i + 1, j + 1);
+ //null passed for 2nd param since it is guaranteed subs is a string
+ sb.append(String.format("[%s(%s, null)]", STRING_INDEX_FUNC, subs));
+ i = str.indexOf(".\"", j + 1);
+ } while (i != -1);
+
+ sb.append(str.substring(j + 1));
+ subs = sb.toString();
+ logger.trace("processStringAccessors: {} converted to {}", str, subs);
+ return subs;
+
+ }
+
+ private static String processExistingBrackets(String str) {
+
+ String subs;
+ StringBuilder sb = new StringBuilder();
+ int i, j = 0;
+
+ i = str.indexOf("[");
+ if (i == -1) return str;
+
+ do {
+ sb.append(str.substring(j, i + 1));
+ j = str.indexOf("]", i + 1);
+ //j cannot be -1
+ subs = str.substring(i + 1, j);
+ sb.append(String.format("%s(%s, \"%s\")", INT_INDEX_FUNC, subs, subs));
+ i = str.indexOf("[", j + 1);
+ } while (i != -1);
+
+ sb.append(str.substring(j));
+ subs = sb.toString();
+ logger.trace("processExistingBrackets: {} converted to {}", str, subs);
+ return subs;
+
+ }
+
+}
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/Visitor.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/Visitor.java
new file mode 100644
index 00000000000..e48de888a40
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/Visitor.java
@@ -0,0 +1,135 @@
+package io.jans.agama.dsl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.saxon.sapling.SaplingDocument;
+import net.sf.saxon.sapling.SaplingElement;
+import net.sf.saxon.sapling.SaplingNode;
+import net.sf.saxon.sapling.Saplings;
+
+import org.antlr.v4.runtime.RuleContext;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import io.jans.agama.antlr.AuthnFlowParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Visitor {
+
+ //public static final String FLOWNAME_XPATH_EXPR = "/flow/header/qname/text()";
+ public static final String FLOWCALL_XPATH_EXPR = "//flow_call/call/call_subject/qname/text()";
+
+ private static final Logger logger = LoggerFactory.getLogger(Visitor.class);
+ private static final Set INCLUDE_SYMBOLS;
+ private static final Set RULES_AS_TEXT;
+
+ static {
+ Integer[] asText = new Integer[] {
+ AuthnFlowParser.RULE_qname, AuthnFlowParser.RULE_short_var, AuthnFlowParser.RULE_variable,
+ AuthnFlowParser.RULE_expression, AuthnFlowParser.RULE_object_expr,
+ AuthnFlowParser.RULE_array_expr, AuthnFlowParser.RULE_simple_expr
+ };
+
+ RULES_AS_TEXT = new HashSet(Arrays.asList(asText));
+
+ //Symbols that may be found as leaves in the tree traversal and must not be skipped
+ Integer[] includeSymbols = new Integer[] {
+ AuthnFlowParser.NOT, AuthnFlowParser.AND, AuthnFlowParser.OR, AuthnFlowParser.MINUS,
+ AuthnFlowParser.NUL, AuthnFlowParser.BOOL, AuthnFlowParser.STRING,
+ AuthnFlowParser.UINT, AuthnFlowParser.SINT, AuthnFlowParser.DECIMAL,
+ AuthnFlowParser.ALPHANUM, AuthnFlowParser.DOTEXPR, AuthnFlowParser.DOTIDXEXPR
+ };
+
+ INCLUDE_SYMBOLS = new HashSet(Arrays.asList(includeSymbols));
+ }
+
+ public static SaplingDocument document(ParseTree tree, int ruleIndex, String treeId) {
+ return Saplings.doc().withChild(visitElement(tree, ruleIndex).withAttr("id", treeId));
+ }
+
+ private static String getRuleName(int ruleIndex) {
+ return AuthnFlowParser.ruleNames[ruleIndex];
+ }
+
+ private static SaplingElement visitElement(ParseTree tree, int ruleIndex) {
+
+ List childElements = new ArrayList<>();
+ int nchildren = tree.getChildCount();
+
+ for (int i = 0; i < nchildren; i++) {
+ ParseTree child = tree.getChild(i);
+ SaplingElement elem = null;
+
+ if (child instanceof RuleContext) {
+
+ RuleContext ruleCtx = (RuleContext) child;
+ int ind = ruleCtx.getRuleIndex();
+
+ if (RULES_AS_TEXT.contains(ind)) {
+ elem = Saplings.elem(getRuleName(ind)).withText(makeTextOf(child));
+ } else {
+ elem = visitElement(child, ind);
+ }
+
+ } else if (child instanceof TerminalNode) {
+ Token token = ((TerminalNode) child).getSymbol();
+ int type = token.getType();
+
+ if (INCLUDE_SYMBOLS.contains(type)) {
+ //logger.debug("{} {}", token.getType(), token.getText());
+ String name = AuthnFlowParser.VOCABULARY.getSymbolicName(type);
+ elem = Saplings.elem(name).withText(token.getText());
+ }
+ }
+
+ if (elem != null) {
+ childElements.add(elem);
+ }
+ }
+
+ return Saplings.elem(getRuleName(ruleIndex))
+ .withChild(childElements.toArray(new SaplingNode[0]));
+
+ }
+
+ private static String makeTextOf(ParseTree tree) {
+
+ String text = null;
+ if (tree instanceof RuleContext) {
+
+ RuleContext ruleCtx = (RuleContext) tree;
+ int ind = ruleCtx.getRuleIndex();
+ boolean isShortVar = AuthnFlowParser.RULE_short_var == ind;
+
+ if (!isShortVar) {
+ text = "";
+ for (int i = 0; i < tree.getChildCount(); i++) {
+ text += makeTextOf(tree.getChild(i));
+ }
+ } else {
+ text = VarsTransformer.correctedVariable(ruleCtx.getText());
+ }
+
+ if (AuthnFlowParser.RULE_variable == ind) {
+ text = VarsTransformer.correctedVariable(text);
+ }
+
+ } else if (tree instanceof TerminalNode) {
+ Token token = ((TerminalNode) tree).getSymbol();
+ text = token.getText();
+ int type = token.getType();
+
+ if (type == AuthnFlowParser.DOTEXPR || type == AuthnFlowParser.DOTIDXEXPR) {
+ text = VarsTransformer.convertToBracketNotation(text);
+ }
+ }
+ return text;
+
+ }
+
+}
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/error/RecognitionErrorListener.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/error/RecognitionErrorListener.java
new file mode 100644
index 00000000000..bc168d3adb2
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/error/RecognitionErrorListener.java
@@ -0,0 +1,29 @@
+package io.jans.agama.dsl.error;
+
+import java.util.Optional;
+
+import org.antlr.v4.runtime.BaseErrorListener;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+
+public class RecognitionErrorListener extends BaseErrorListener {
+
+ private SyntaxException error;
+
+ public SyntaxException getError() {
+ return error;
+ }
+
+ @Override
+ public void syntaxError(Recognizer, ?> recognizer, Object offendingSymbol, int line,
+ int charPositionInLine, String msg, RecognitionException exception) {
+
+ if (error == null) {
+ error = new SyntaxException(msg,
+ Optional.ofNullable(offendingSymbol).map(Object::toString)
+ .orElse(null), line, charPositionInLine);
+ }
+
+ }
+
+}
diff --git a/agama/transpiler/src/main/java/io/jans/agama/dsl/error/SyntaxException.java b/agama/transpiler/src/main/java/io/jans/agama/dsl/error/SyntaxException.java
new file mode 100644
index 00000000000..d5296617423
--- /dev/null
+++ b/agama/transpiler/src/main/java/io/jans/agama/dsl/error/SyntaxException.java
@@ -0,0 +1,66 @@
+package io.jans.agama.dsl.error;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.util.Optional;
+import java.util.function.Function;
+
+@JsonIgnoreProperties( { "cause", "localizedMessage", "stackTrace", "suppressed" } )
+public class SyntaxException extends Exception {
+
+ private String error;
+ private String symbol;
+ private int line;
+ private int column;
+
+ public SyntaxException() {
+ }
+
+ public SyntaxException(String error, String symbol, int line, int column) {
+ this.error = error;
+ this.symbol = symbol;
+ this.line = line;
+ this.column = column;
+ }
+
+ @Override
+ public String getMessage() {
+
+ String msg = "Syntax error: ";
+ msg += Optional.ofNullable(error).map(Function.identity()).orElse("");
+ msg += Optional.ofNullable(symbol).map(s -> String.format("\nSymbol: %s", s)).orElse("");
+ msg += String.format("\nLine: %d", line);
+ msg += String.format("\nColumn: %d", column + 1);
+ return msg;
+
+ }
+
+ /**
+ * @return the error
+ */
+ public String getError() {
+ return error;
+ }
+
+ /**
+ * @return the symbol
+ */
+ public String getSymbol() {
+ return symbol;
+ }
+
+ /**
+ * @return the line
+ */
+ public int getLine() {
+ return line;
+ }
+
+ /**
+ * @return the column
+ */
+ public int getColumn() {
+ return column;
+ }
+
+}
diff --git a/agama/transpiler/src/main/resources/JSGenerator.ftl b/agama/transpiler/src/main/resources/JSGenerator.ftl
new file mode 100644
index 00000000000..99b965e354f
--- /dev/null
+++ b/agama/transpiler/src/main/resources/JSGenerator.ftl
@@ -0,0 +1,235 @@
+<#ftl output_format="JavaScript">
+<#--
+- This templates generates valid JS code that should be run in non-strict mode
+- Only one function is created and must not contain inner functions
+- Any functions called here are implemented in file util.js
+- An initial underscore in variables and function names prevent flow writers to use variables with the same names in their DSL code
+-->
+//Generated at ${.now?iso_utc}
+function ${flow.@id}<#recurse flow>
+}
+
+<#macro header>
+(
+<#if .node.inputs?size gt 0>
+ ${.node.inputs.short_var?join(", ")}
+#if>
+) {
+const _basePath = ${.node.base.STRING}
+let _it = null, _it2 = null
+<#-- idx is accessible to flow writers (it's not underscore-prefixed). It allows to access the status of loops -->
+let idx = [], _items = []
+#macro>
+
+<#macro statement>
+ <#recurse>
+#macro>
+
+<#macro assignment><@util_preassign node=.node /> ${.node.expression}
+#macro>
+
+<#macro rrf_call>
+ <#local hasbool = .node.BOOL?size gt 0>
+
+ <#if .node.statusr_block?size gt 0><#visit .node.statusr_block>#if>
+ <#if .node.variable?size = 0>
+ _it = {}
+ <#else>
+ _it = ${.node.variable}
+ #if>
+
+ _it = _renderReplyFetch(_basePath, ${.node.STRING}, ${hasbool?then(.node.BOOL, "false")}, _it)
+ <#-- See FlowService#continueFlow > scriptCtx#resumeContinuation
+ string parsing via JS was preferred over returning a Java Map directly because it feels more
+ natural for RRF to return a native JS object; it creates the illusion there was no Java involved -->
+ _it2 = JSON.parse(_it.second)
+ if (_it.first.booleanValue()) return _abort(_it2)
+
+ <@util_preassign node=.node /> _it2
+ <#-- Clear temp variables to make serialization lighter (in the next RRF call) -->
+ _it = null
+ _it2 = null
+#macro>
+
+<#macro action_call>
+ <#local catch=.node.preassign_catch?size gt 0>
+
+ <#if catch>
+try {
+ #if>
+ <@util_preassign node=.node /> _actionCall(
+ <#if .node.static_call?size gt 0>
+ null, false, "${.node.static_call.qname}", "${.node.static_call.ALPHANUM}"
+ , <@util_argslist node=.node.static_call />
+ <#else>
+ ${.node.oo_call.variable}, true, null, "${.node.oo_call.ALPHANUM}"
+ , <@util_argslist node=.node.oo_call />
+ #if>
+ )
+
+ <#if catch>
+} catch (_e) {
+ var ${.node.preassign_catch.short_var} = _e
+}
+ #if>
+#macro>
+
+<#macro flow_call>
+ <#if .node.variable?size gt 0>
+ _it = ${.node.variable}
+ <#else>
+ _it = "${.node.qname}"
+ #if>
+ <@util_preassign node=.node />
+_flowCall(_it, _basePath, <@util_url_overrides node=.node.overrides/>, <@util_argslist node=.node />)
+#macro>
+
+<#macro rfac>
+<#if .node.variable?size = 0>
+ _it = ${.node.STRING}
+<#else>
+ _it = ${.node.variable}
+#if>
+ <@util_preassign node=.node /> _redirectFetchAtCallback(_it)
+#macro>
+
+<#macro finish>
+<#if .node.variable?size = 0>
+ _it = ${.node.BOOL}
+<#else>
+ _it = ${.node.variable}
+#if>
+return _finish(_it)
+#macro>
+
+<#macro loopy>
+ <#if .node.variable?size = 0>
+_it = ${.node.UINT}
+ <#else>
+_it = ${.node.variable}
+ #if>
+_ensureNumber(_it, "Number of iterations passed to Repeat is invalid")
+
+idx.push(0)
+for (let _times = _it; _times > 0; _times--) {
+<@util_loop_body node=.node />
+ idx[idx.length - 1]++
+}
+_it = idx.pop()
+
+<#if .node.preassign?size gt 0>
+<@util_preassign node=.node /> _it
+#if>
+
+#macro>
+
+<#macro loop>
+_it = _iterable(${.node.variable}, "Variable to iterate over is not map, list, or string")
+
+_items.push(_it)
+idx.push(0)
+for (let _item of _items[_items.length - 1]) {
+ var ${.node.short_var} = _item
+<@util_loop_body node=.node />
+ idx[idx.length - 1]++
+}
+_items.pop()
+_it = idx.pop()
+
+<#if .node.preassign?size gt 0>
+<@util_preassign node=.node /> _it
+#if>
+
+#macro>
+
+<#macro ifelse>
+if (<#recurse .node.caseof>) {
+ <#list .node.statement as st>
+ <#recurse st>
+ #list>
+}
+<@util_else node=.node.elseblock />
+#macro>
+
+<#macro quit_stmt>
+if (<#recurse .node.caseof>) break
+
+<#list .node.statement as st>
+ <#recurse st>
+#list>
+#macro>
+
+<#macro choice>
+ <#list .node.option as case>
+ <#if case?index gt 0>else #if>
+if (_equals(${.node.simple_expr }, ${case.simple_expr})) {
+ <#list case.statement as st>
+ <#recurse st>
+ #list>
+}
+ #list>
+<@util_else node=.node.elseblock />
+#macro>
+
+<#macro boolean_expr>
+ <#if .node.NOT?size gt 0>!#if>
+_equals(${.node.simple_expr[0]}, ${.node.simple_expr[1]})
+#macro>
+
+<#macro boolean_op_expr>
+ <#if .node.AND?size = 0>
+||
+ <#else>
+&&
+ #if>
+ <#recurse>
+#macro>
+
+<#macro log>
+_log(<@util_argslist node=.node />)
+#macro>
+
+<#macro statusr_block>
+ <#local isuint = .node.statusr_allow.variable?size = 0>
+ <#local isequality = statusr_until.boolean_expr.NOT?size gt 0>
+<#--
+_allowStatusRequest(${isuint?then(.node.statusr_allow.UINT!"", .node.statusr_allow.variable!"")},
+ "${.node.statusr_until.boolean_expr.simple_expr[0]!""}", "${.node.statusr_until.boolean_expr.simple_expr[1]!""}",
+ ${isequality?c}, [<#recurse .node.statusr_reply>]) -->
+#macro>
+
+<#macro util_loop_body node>
+ <#list .node.statement as st>
+ <#recurse st>
+ #list>
+
+ <#if .node.quit_stmt?size gt 0><#visit .node.quit_stmt>#if>
+#macro>
+
+<#macro util_else node>
+<#if node?size gt 0>
+else {
+ <#recurse node>
+}
+#if>
+#macro>
+
+<#macro util_preassign node>
+ <#local var = "" >
+ <#if node.preassign?size = 0>
+ <#if node.preassign_catch?size gt 0 && node.preassign_catch.variable?size gt 0>
+ <#local var = node.preassign_catch.variable >
+ #if>
+ <#else>
+ <#local var = node.preassign.variable >
+ #if>
+ <#if var?length gt 0>
+<#if var?index_of(".") == -1 && var?index_of("[") == -1>var #if>${var} =
+ #if>
+#macro>
+
+<#macro util_argslist node>[ ${node.argument.simple_expr?join(", ")} ]#macro>
+
+<#macro util_url_overrides node>[ ${node.STRING?join(", ")} ]#macro>
+
+<#macro @element>#macro>