From 034bedfb46a523043f3d3be2fd66e8861ee1757d Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 29 Mar 2022 13:16:06 +0200 Subject: [PATCH] Incremental work on DSL --- src/core/Elsa.Core/Models/Argument.cs | 4 +- src/dsl/Elsa.Dsl/Abstractions/ElsaParser.cs | 290 ++++++++++-------- .../Elsa.Dsl/Abstractions/ElsaParser.interp | 2 +- .../Abstractions/ElsaParserBaseVisitor.cs | 11 + .../Abstractions/ElsaParserVisitor.cs | 7 + src/dsl/Elsa.Dsl/Dsl/ElsaParser.g4 | 37 +-- src/dsl/Elsa.Dsl/Dsl/Samples/If.elsa | 2 +- .../VisitExternalExpression.cs | 1 + .../VisitProperty.cs | 6 +- .../console/Elsa.Samples.Console2/Demo1.elsa | 1 + .../console/Elsa.Samples.Console2/Demo2.elsa | 14 + .../console/Elsa.Samples.Console2/Demo3.elsa | 1 + .../console/Elsa.Samples.Console2/Demo4.elsa | 16 + .../Elsa.Samples.Console2.csproj | 4 + .../console/Elsa.Samples.Console2/Program.cs | 9 +- .../Elsa.Samples.Console2/Sample1.elsa | 2 +- 16 files changed, 249 insertions(+), 158 deletions(-) create mode 100644 src/samples/console/Elsa.Samples.Console2/Demo1.elsa create mode 100644 src/samples/console/Elsa.Samples.Console2/Demo2.elsa create mode 100644 src/samples/console/Elsa.Samples.Console2/Demo3.elsa create mode 100644 src/samples/console/Elsa.Samples.Console2/Demo4.elsa diff --git a/src/core/Elsa.Core/Models/Argument.cs b/src/core/Elsa.Core/Models/Argument.cs index ea5d4f96e..e156cc291 100644 --- a/src/core/Elsa.Core/Models/Argument.cs +++ b/src/core/Elsa.Core/Models/Argument.cs @@ -2,12 +2,14 @@ namespace Elsa.Models; public abstract class Argument { + protected Argument(){} + protected Argument(RegisterLocationReference locationReference, Func? valueConverter = default) { LocationReference = locationReference; ValueConverter = valueConverter; } - public RegisterLocationReference LocationReference { get; set; } + public RegisterLocationReference LocationReference { get; set; } = default!; public Func? ValueConverter { get; set; } } \ No newline at end of file diff --git a/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.cs b/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.cs index df60d7ba5..c6ede5a31 100644 --- a/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.cs +++ b/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.cs @@ -143,7 +143,7 @@ public partial class ElsaParser : Parser { State = 46; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << VARIABLE) | (1L << LET) | (1L << IF) | (1L << FOR) | (1L << RETURN) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << CURLYBRACE_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << LINE_COMMENT) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << VARIABLE) | (1L << LET) | (1L << IF) | (1L << FOR) | (1L << RETURN) | (1L << EXPRESSION_MARKER) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << CURLYBRACE_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << LINE_COMMENT) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { { State = 44; ErrorHandler.Sync(this); @@ -154,6 +154,7 @@ public partial class ElsaParser : Parser { case IF: case FOR: case RETURN: + case EXPRESSION_MARKER: case MINUS: case PARENTHESES_OPEN: case BRACKET_OPEN: @@ -900,7 +901,7 @@ public partial class ElsaParser : Parser { State = 134; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << VARIABLE) | (1L << LET) | (1L << IF) | (1L << FOR) | (1L << RETURN) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << CURLYBRACE_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << VARIABLE) | (1L << LET) | (1L << IF) | (1L << FOR) | (1L << RETURN) | (1L << EXPRESSION_MARKER) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << CURLYBRACE_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { { { State = 131; @@ -1326,7 +1327,7 @@ public partial class ElsaParser : Parser { State = 182; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << EXPRESSION_MARKER) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { { State = 181; expr(0); @@ -1684,6 +1685,18 @@ public partial class ElsaParser : Parser { else return visitor.VisitChildren(this); } } + public partial class ExpressionMarkerExprContext : ExprContext { + [System.Diagnostics.DebuggerNonUserCode] public ExpressionMarkerContext expressionMarker() { + return GetRuleContext(0); + } + public ExpressionMarkerExprContext(ExprContext context) { CopyFrom(context); } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IElsaParserVisitor typedVisitor = visitor as IElsaParserVisitor; + if (typedVisitor != null) return typedVisitor.VisitExpressionMarkerExpr(this); + else return visitor.VisitChildren(this); + } + } public partial class BackTickStringValueExprContext : ExprContext { [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BACKTICKSTRING_VAL() { return GetToken(ElsaParser.BACKTICKSTRING_VAL, 0); } public BackTickStringValueExprContext(ExprContext context) { CopyFrom(context); } @@ -1718,6 +1731,9 @@ public partial class ElsaParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(ElsaParser.EQUALS, 0); } [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER() { return GetToken(ElsaParser.GREATER, 0); } [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS() { return GetToken(ElsaParser.LESS, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT_EQUALS() { return GetToken(ElsaParser.NOT_EQUALS, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER_EQUALS() { return GetToken(ElsaParser.GREATER_EQUALS, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS_EQUALS() { return GetToken(ElsaParser.LESS_EQUALS, 0); } public CompareExprContext(ExprContext context) { CopyFrom(context); } [System.Diagnostics.DebuggerNonUserCode] public override TResult Accept(IParseTreeVisitor visitor) { @@ -1744,7 +1760,7 @@ public partial class ElsaParser : Parser { int _alt; EnterOuterAlt(_localctx, 1); { - State = 229; + State = 230; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,22,Context) ) { case 1: @@ -1759,134 +1775,143 @@ public partial class ElsaParser : Parser { break; case 2: { - _localctx = new ObjectExprContext(_localctx); + _localctx = new ExpressionMarkerExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 208; - @object(); + expressionMarker(); } break; case 3: { - _localctx = new NewObjectExprContext(_localctx); + _localctx = new ObjectExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 209; - newObject(); + @object(); } break; case 4: { - _localctx = new NegateExprContext(_localctx); + _localctx = new NewObjectExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 210; - Match(MINUS); - State = 211; - expr(13); + newObject(); } break; case 5: { - _localctx = new NotExprContext(_localctx); + _localctx = new NegateExprContext(_localctx); Context = _localctx; _prevctx = _localctx; + State = 211; + Match(MINUS); State = 212; - Match(EXCLAMATION); - State = 213; - expr(12); + expr(13); } break; case 6: { - _localctx = new IntegerValueExprContext(_localctx); + _localctx = new NotExprContext(_localctx); Context = _localctx; _prevctx = _localctx; + State = 213; + Match(EXCLAMATION); State = 214; - Match(INTEGER_VAL); + expr(12); } break; case 7: { - _localctx = new StringValueExprContext(_localctx); + _localctx = new IntegerValueExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 215; - Match(STRING_VAL); + Match(INTEGER_VAL); } break; case 8: { - _localctx = new BackTickStringValueExprContext(_localctx); + _localctx = new StringValueExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 216; - Match(BACKTICKSTRING_VAL); + Match(STRING_VAL); } break; case 9: { - _localctx = new ParenthesesExprContext(_localctx); + _localctx = new BackTickStringValueExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 217; - Match(PARENTHESES_OPEN); - State = 219; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { - { - State = 218; - exprList(); - } - } - - State = 221; - Match(PARENTHESES_CLOSE); + Match(BACKTICKSTRING_VAL); } break; case 10: { - _localctx = new BracketsExprContext(_localctx); + _localctx = new ParenthesesExprContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 222; - Match(BRACKET_OPEN); - State = 224; + State = 218; + Match(PARENTHESES_OPEN); + State = 220; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << EXPRESSION_MARKER) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { { - State = 223; + State = 219; exprList(); } } - State = 226; - Match(BRACKET_CLOSE); + State = 222; + Match(PARENTHESES_CLOSE); } break; case 11: { - _localctx = new MethodCallExprContext(_localctx); + _localctx = new BracketsExprContext(_localctx); Context = _localctx; _prevctx = _localctx; + State = 223; + Match(BRACKET_OPEN); + State = 225; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEW) | (1L << EXPRESSION_MARKER) | (1L << MINUS) | (1L << PARENTHESES_OPEN) | (1L << BRACKET_OPEN) | (1L << EXCLAMATION) | (1L << STRING_VAL) | (1L << BACKTICKSTRING_VAL) | (1L << INTEGER_VAL) | (1L << ID))) != 0)) { + { + State = 224; + exprList(); + } + } + State = 227; - methodCall(); + Match(BRACKET_CLOSE); } break; case 12: { - _localctx = new VariableExprContext(_localctx); + _localctx = new MethodCallExprContext(_localctx); Context = _localctx; _prevctx = _localctx; State = 228; + methodCall(); + } + break; + case 13: + { + _localctx = new VariableExprContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 229; Match(ID); } break; } Context.Stop = TokenStream.LT(-1); - State = 249; + State = 250; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,24,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -1895,18 +1920,18 @@ public partial class ElsaParser : Parser { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 247; + State = 248; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,23,Context) ) { case 1: { _localctx = new MultiplyExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 231; - if (!(Precpred(Context, 11))) throw new FailedPredicateException(this, "Precpred(Context, 11)"); State = 232; - Match(STAR); + if (!(Precpred(Context, 11))) throw new FailedPredicateException(this, "Precpred(Context, 11)"); State = 233; + Match(STAR); + State = 234; expr(12); } break; @@ -1914,11 +1939,11 @@ public partial class ElsaParser : Parser { { _localctx = new AddExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 234; - if (!(Precpred(Context, 10))) throw new FailedPredicateException(this, "Precpred(Context, 10)"); State = 235; - Match(PLUS); + if (!(Precpred(Context, 10))) throw new FailedPredicateException(this, "Precpred(Context, 10)"); State = 236; + Match(PLUS); + State = 237; expr(11); } break; @@ -1926,11 +1951,11 @@ public partial class ElsaParser : Parser { { _localctx = new SubtractExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 237; - if (!(Precpred(Context, 9))) throw new FailedPredicateException(this, "Precpred(Context, 9)"); State = 238; - Match(MINUS); + if (!(Precpred(Context, 9))) throw new FailedPredicateException(this, "Precpred(Context, 9)"); State = 239; + Match(MINUS); + State = 240; expr(10); } break; @@ -1938,18 +1963,18 @@ public partial class ElsaParser : Parser { { _localctx = new CompareExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 240; - if (!(Precpred(Context, 8))) throw new FailedPredicateException(this, "Precpred(Context, 8)"); State = 241; + if (!(Precpred(Context, 8))) throw new FailedPredicateException(this, "Precpred(Context, 8)"); + State = 242; _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GREATER) | (1L << EQUALS) | (1L << LESS))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GREATER) | (1L << EQUALS) | (1L << NOT_EQUALS) | (1L << GREATER_EQUALS) | (1L << LESS) | (1L << LESS_EQUALS))) != 0)) ) { ErrorHandler.RecoverInline(this); } else { ErrorHandler.ReportMatch(this); Consume(); } - State = 242; + State = 243; expr(9); } break; @@ -1957,9 +1982,9 @@ public partial class ElsaParser : Parser { { _localctx = new IncrementExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 243; - if (!(Precpred(Context, 15))) throw new FailedPredicateException(this, "Precpred(Context, 15)"); State = 244; + if (!(Precpred(Context, 15))) throw new FailedPredicateException(this, "Precpred(Context, 15)"); + State = 245; Match(INCREMENT); } break; @@ -1967,16 +1992,16 @@ public partial class ElsaParser : Parser { { _localctx = new DecrementExprContext(new ExprContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_expr); - State = 245; - if (!(Precpred(Context, 14))) throw new FailedPredicateException(this, "Precpred(Context, 14)"); State = 246; + if (!(Precpred(Context, 14))) throw new FailedPredicateException(this, "Precpred(Context, 14)"); + State = 247; Match(DECREMENT); } break; } } } - State = 251; + State = 252; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,24,Context); } @@ -2025,21 +2050,21 @@ public partial class ElsaParser : Parser { try { EnterOuterAlt(_localctx, 1); { - State = 252; + State = 253; expr(0); - State = 257; + State = 258; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==COMMA) { { { - State = 253; - Match(COMMA); State = 254; + Match(COMMA); + State = 255; expr(0); } } - State = 259; + State = 260; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -2076,7 +2101,7 @@ public partial class ElsaParser : Parser { private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', - '\x5964', '\x3', '\x32', '\x107', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', + '\x5964', '\x3', '\x32', '\x108', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', '\t', '\v', @@ -2120,20 +2145,20 @@ public partial class ElsaParser : Parser { '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', - '\x15', '\x5', '\x15', '\xDE', '\n', '\x15', '\x3', '\x15', '\x3', '\x15', - '\x3', '\x15', '\x5', '\x15', '\xE3', '\n', '\x15', '\x3', '\x15', '\x3', - '\x15', '\x3', '\x15', '\x5', '\x15', '\xE8', '\n', '\x15', '\x3', '\x15', + '\x15', '\x3', '\x15', '\x5', '\x15', '\xDF', '\n', '\x15', '\x3', '\x15', + '\x3', '\x15', '\x3', '\x15', '\x5', '\x15', '\xE4', '\n', '\x15', '\x3', + '\x15', '\x3', '\x15', '\x3', '\x15', '\x5', '\x15', '\xE9', '\n', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', - '\a', '\x15', '\xFA', '\n', '\x15', '\f', '\x15', '\xE', '\x15', '\xFD', - '\v', '\x15', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\a', '\x16', - '\x102', '\n', '\x16', '\f', '\x16', '\xE', '\x16', '\x105', '\v', '\x16', - '\x3', '\x16', '\x3', 'j', '\x3', '(', '\x17', '\x2', '\x4', '\x6', '\b', - '\n', '\f', '\xE', '\x10', '\x12', '\x14', '\x16', '\x18', '\x1A', '\x1C', - '\x1E', ' ', '\"', '$', '&', '(', '*', '\x2', '\x4', '\x4', '\x2', '\xF', - '\x13', '\x30', '\x30', '\x5', '\x2', '\x4', '\x4', '\x1C', '\x1C', '\x1F', - '\x1F', '\x2', '\x120', '\x2', '\x30', '\x3', '\x2', '\x2', '\x2', '\x4', + '\x3', '\x15', '\a', '\x15', '\xFB', '\n', '\x15', '\f', '\x15', '\xE', + '\x15', '\xFE', '\v', '\x15', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', + '\a', '\x16', '\x103', '\n', '\x16', '\f', '\x16', '\xE', '\x16', '\x106', + '\v', '\x16', '\x3', '\x16', '\x3', 'j', '\x3', '(', '\x17', '\x2', '\x4', + '\x6', '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', '\x16', '\x18', + '\x1A', '\x1C', '\x1E', ' ', '\"', '$', '&', '(', '*', '\x2', '\x4', '\x4', + '\x2', '\xF', '\x13', '\x30', '\x30', '\x4', '\x2', '\x4', '\x4', '\x1C', + ' ', '\x2', '\x122', '\x2', '\x30', '\x3', '\x2', '\x2', '\x2', '\x4', '\x33', '\x3', '\x2', '\x2', '\x2', '\x6', '\x37', '\x3', '\x2', '\x2', '\x2', '\b', '\x45', '\x3', '\x2', '\x2', '\x2', '\n', 'O', '\x3', '\x2', '\x2', '\x2', '\f', 'Y', '\x3', '\x2', '\x2', '\x2', '\xE', '\x65', '\x3', @@ -2144,7 +2169,7 @@ public partial class ElsaParser : Parser { '\x3', '\x2', '\x2', '\x2', '\x1E', '\x93', '\x3', '\x2', '\x2', '\x2', ' ', '\x9B', '\x3', '\x2', '\x2', '\x2', '\"', '\xCA', '\x3', '\x2', '\x2', '\x2', '$', '\xCC', '\x3', '\x2', '\x2', '\x2', '&', '\xCE', '\x3', '\x2', - '\x2', '\x2', '(', '\xE7', '\x3', '\x2', '\x2', '\x2', '*', '\xFE', '\x3', + '\x2', '\x2', '(', '\xE8', '\x3', '\x2', '\x2', '\x2', '*', '\xFF', '\x3', '\x2', '\x2', '\x2', ',', '/', '\x5', '\"', '\x12', '\x2', '-', '/', '\a', '.', '\x2', '\x2', '.', ',', '\x3', '\x2', '\x2', '\x2', '.', '-', '\x3', '\x2', '\x2', '\x2', '/', '\x32', '\x3', '\x2', '\x2', '\x2', '\x30', @@ -2254,53 +2279,54 @@ public partial class ElsaParser : Parser { '#', '\x3', '\x2', '\x2', '\x2', '\xCC', '\xCD', '\x5', '\"', '\x12', '\x2', '\xCD', '%', '\x3', '\x2', '\x2', '\x2', '\xCE', '\xCF', '\x5', '\"', '\x12', '\x2', '\xCF', '\'', '\x3', '\x2', '\x2', '\x2', '\xD0', - '\xD1', '\b', '\x15', '\x1', '\x2', '\xD1', '\xE8', '\x5', '\x14', '\v', - '\x2', '\xD2', '\xE8', '\x5', '\x4', '\x3', '\x2', '\xD3', '\xE8', '\x5', - '\x6', '\x4', '\x2', '\xD4', '\xD5', '\a', '\x1A', '\x2', '\x2', '\xD5', - '\xE8', '\x5', '(', '\x15', '\xF', '\xD6', '\xD7', '\a', '(', '\x2', '\x2', - '\xD7', '\xE8', '\x5', '(', '\x15', '\xE', '\xD8', '\xE8', '\a', '/', - '\x2', '\x2', '\xD9', '\xE8', '\a', ',', '\x2', '\x2', '\xDA', '\xE8', - '\a', '-', '\x2', '\x2', '\xDB', '\xDD', '\a', '\"', '\x2', '\x2', '\xDC', - '\xDE', '\x5', '*', '\x16', '\x2', '\xDD', '\xDC', '\x3', '\x2', '\x2', - '\x2', '\xDD', '\xDE', '\x3', '\x2', '\x2', '\x2', '\xDE', '\xDF', '\x3', - '\x2', '\x2', '\x2', '\xDF', '\xE8', '\a', '#', '\x2', '\x2', '\xE0', - '\xE2', '\a', '$', '\x2', '\x2', '\xE1', '\xE3', '\x5', '*', '\x16', '\x2', - '\xE2', '\xE1', '\x3', '\x2', '\x2', '\x2', '\xE2', '\xE3', '\x3', '\x2', - '\x2', '\x2', '\xE3', '\xE4', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE8', - '\a', '%', '\x2', '\x2', '\xE5', '\xE8', '\x5', '\x12', '\n', '\x2', '\xE6', - '\xE8', '\a', '\x30', '\x2', '\x2', '\xE7', '\xD0', '\x3', '\x2', '\x2', - '\x2', '\xE7', '\xD2', '\x3', '\x2', '\x2', '\x2', '\xE7', '\xD3', '\x3', - '\x2', '\x2', '\x2', '\xE7', '\xD4', '\x3', '\x2', '\x2', '\x2', '\xE7', - '\xD6', '\x3', '\x2', '\x2', '\x2', '\xE7', '\xD8', '\x3', '\x2', '\x2', - '\x2', '\xE7', '\xD9', '\x3', '\x2', '\x2', '\x2', '\xE7', '\xDA', '\x3', - '\x2', '\x2', '\x2', '\xE7', '\xDB', '\x3', '\x2', '\x2', '\x2', '\xE7', - '\xE0', '\x3', '\x2', '\x2', '\x2', '\xE7', '\xE5', '\x3', '\x2', '\x2', - '\x2', '\xE7', '\xE6', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xFB', '\x3', - '\x2', '\x2', '\x2', '\xE9', '\xEA', '\f', '\r', '\x2', '\x2', '\xEA', - '\xEB', '\a', '\x1B', '\x2', '\x2', '\xEB', '\xFA', '\x5', '(', '\x15', - '\xE', '\xEC', '\xED', '\f', '\f', '\x2', '\x2', '\xED', '\xEE', '\a', - '\x19', '\x2', '\x2', '\xEE', '\xFA', '\x5', '(', '\x15', '\r', '\xEF', - '\xF0', '\f', '\v', '\x2', '\x2', '\xF0', '\xF1', '\a', '\x1A', '\x2', - '\x2', '\xF1', '\xFA', '\x5', '(', '\x15', '\f', '\xF2', '\xF3', '\f', - '\n', '\x2', '\x2', '\xF3', '\xF4', '\t', '\x3', '\x2', '\x2', '\xF4', - '\xFA', '\x5', '(', '\x15', '\v', '\xF5', '\xF6', '\f', '\x11', '\x2', - '\x2', '\xF6', '\xFA', '\a', '\x5', '\x2', '\x2', '\xF7', '\xF8', '\f', - '\x10', '\x2', '\x2', '\xF8', '\xFA', '\a', '\x6', '\x2', '\x2', '\xF9', - '\xE9', '\x3', '\x2', '\x2', '\x2', '\xF9', '\xEC', '\x3', '\x2', '\x2', - '\x2', '\xF9', '\xEF', '\x3', '\x2', '\x2', '\x2', '\xF9', '\xF2', '\x3', - '\x2', '\x2', '\x2', '\xF9', '\xF5', '\x3', '\x2', '\x2', '\x2', '\xF9', - '\xF7', '\x3', '\x2', '\x2', '\x2', '\xFA', '\xFD', '\x3', '\x2', '\x2', - '\x2', '\xFB', '\xF9', '\x3', '\x2', '\x2', '\x2', '\xFB', '\xFC', '\x3', - '\x2', '\x2', '\x2', '\xFC', ')', '\x3', '\x2', '\x2', '\x2', '\xFD', - '\xFB', '\x3', '\x2', '\x2', '\x2', '\xFE', '\x103', '\x5', '(', '\x15', - '\x2', '\xFF', '\x100', '\a', '\x18', '\x2', '\x2', '\x100', '\x102', - '\x5', '(', '\x15', '\x2', '\x101', '\xFF', '\x3', '\x2', '\x2', '\x2', - '\x102', '\x105', '\x3', '\x2', '\x2', '\x2', '\x103', '\x101', '\x3', - '\x2', '\x2', '\x2', '\x103', '\x104', '\x3', '\x2', '\x2', '\x2', '\x104', - '+', '\x3', '\x2', '\x2', '\x2', '\x105', '\x103', '\x3', '\x2', '\x2', - '\x2', '\x1C', '.', '\x30', '\x35', '=', '\x41', 'I', 'M', 'S', 'W', '\x65', - 'j', 't', '}', '\x82', '\x88', '\x8F', '\x98', '\xA8', '\xB8', '\xCA', - '\xDD', '\xE2', '\xE7', '\xF9', '\xFB', '\x103', + '\xD1', '\b', '\x15', '\x1', '\x2', '\xD1', '\xE9', '\x5', '\x14', '\v', + '\x2', '\xD2', '\xE9', '\x5', '\xE', '\b', '\x2', '\xD3', '\xE9', '\x5', + '\x4', '\x3', '\x2', '\xD4', '\xE9', '\x5', '\x6', '\x4', '\x2', '\xD5', + '\xD6', '\a', '\x1A', '\x2', '\x2', '\xD6', '\xE9', '\x5', '(', '\x15', + '\xF', '\xD7', '\xD8', '\a', '(', '\x2', '\x2', '\xD8', '\xE9', '\x5', + '(', '\x15', '\xE', '\xD9', '\xE9', '\a', '/', '\x2', '\x2', '\xDA', '\xE9', + '\a', ',', '\x2', '\x2', '\xDB', '\xE9', '\a', '-', '\x2', '\x2', '\xDC', + '\xDE', '\a', '\"', '\x2', '\x2', '\xDD', '\xDF', '\x5', '*', '\x16', + '\x2', '\xDE', '\xDD', '\x3', '\x2', '\x2', '\x2', '\xDE', '\xDF', '\x3', + '\x2', '\x2', '\x2', '\xDF', '\xE0', '\x3', '\x2', '\x2', '\x2', '\xE0', + '\xE9', '\a', '#', '\x2', '\x2', '\xE1', '\xE3', '\a', '$', '\x2', '\x2', + '\xE2', '\xE4', '\x5', '*', '\x16', '\x2', '\xE3', '\xE2', '\x3', '\x2', + '\x2', '\x2', '\xE3', '\xE4', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE5', + '\x3', '\x2', '\x2', '\x2', '\xE5', '\xE9', '\a', '%', '\x2', '\x2', '\xE6', + '\xE9', '\x5', '\x12', '\n', '\x2', '\xE7', '\xE9', '\a', '\x30', '\x2', + '\x2', '\xE8', '\xD0', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xD2', '\x3', + '\x2', '\x2', '\x2', '\xE8', '\xD3', '\x3', '\x2', '\x2', '\x2', '\xE8', + '\xD4', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xD5', '\x3', '\x2', '\x2', + '\x2', '\xE8', '\xD7', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xD9', '\x3', + '\x2', '\x2', '\x2', '\xE8', '\xDA', '\x3', '\x2', '\x2', '\x2', '\xE8', + '\xDB', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xDC', '\x3', '\x2', '\x2', + '\x2', '\xE8', '\xE1', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xE6', '\x3', + '\x2', '\x2', '\x2', '\xE8', '\xE7', '\x3', '\x2', '\x2', '\x2', '\xE9', + '\xFC', '\x3', '\x2', '\x2', '\x2', '\xEA', '\xEB', '\f', '\r', '\x2', + '\x2', '\xEB', '\xEC', '\a', '\x1B', '\x2', '\x2', '\xEC', '\xFB', '\x5', + '(', '\x15', '\xE', '\xED', '\xEE', '\f', '\f', '\x2', '\x2', '\xEE', + '\xEF', '\a', '\x19', '\x2', '\x2', '\xEF', '\xFB', '\x5', '(', '\x15', + '\r', '\xF0', '\xF1', '\f', '\v', '\x2', '\x2', '\xF1', '\xF2', '\a', + '\x1A', '\x2', '\x2', '\xF2', '\xFB', '\x5', '(', '\x15', '\f', '\xF3', + '\xF4', '\f', '\n', '\x2', '\x2', '\xF4', '\xF5', '\t', '\x3', '\x2', + '\x2', '\xF5', '\xFB', '\x5', '(', '\x15', '\v', '\xF6', '\xF7', '\f', + '\x11', '\x2', '\x2', '\xF7', '\xFB', '\a', '\x5', '\x2', '\x2', '\xF8', + '\xF9', '\f', '\x10', '\x2', '\x2', '\xF9', '\xFB', '\a', '\x6', '\x2', + '\x2', '\xFA', '\xEA', '\x3', '\x2', '\x2', '\x2', '\xFA', '\xED', '\x3', + '\x2', '\x2', '\x2', '\xFA', '\xF0', '\x3', '\x2', '\x2', '\x2', '\xFA', + '\xF3', '\x3', '\x2', '\x2', '\x2', '\xFA', '\xF6', '\x3', '\x2', '\x2', + '\x2', '\xFA', '\xF8', '\x3', '\x2', '\x2', '\x2', '\xFB', '\xFE', '\x3', + '\x2', '\x2', '\x2', '\xFC', '\xFA', '\x3', '\x2', '\x2', '\x2', '\xFC', + '\xFD', '\x3', '\x2', '\x2', '\x2', '\xFD', ')', '\x3', '\x2', '\x2', + '\x2', '\xFE', '\xFC', '\x3', '\x2', '\x2', '\x2', '\xFF', '\x104', '\x5', + '(', '\x15', '\x2', '\x100', '\x101', '\a', '\x18', '\x2', '\x2', '\x101', + '\x103', '\x5', '(', '\x15', '\x2', '\x102', '\x100', '\x3', '\x2', '\x2', + '\x2', '\x103', '\x106', '\x3', '\x2', '\x2', '\x2', '\x104', '\x102', + '\x3', '\x2', '\x2', '\x2', '\x104', '\x105', '\x3', '\x2', '\x2', '\x2', + '\x105', '+', '\x3', '\x2', '\x2', '\x2', '\x106', '\x104', '\x3', '\x2', + '\x2', '\x2', '\x1C', '.', '\x30', '\x35', '=', '\x41', 'I', 'M', 'S', + 'W', '\x65', 'j', 't', '}', '\x82', '\x88', '\x8F', '\x98', '\xA8', '\xB8', + '\xCA', '\xDE', '\xE3', '\xE8', '\xFA', '\xFC', '\x104', }; public static readonly ATN _ATN = diff --git a/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.interp b/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.interp index e2a3357de..62fb327fe 100644 --- a/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.interp +++ b/src/dsl/Elsa.Dsl/Abstractions/ElsaParser.interp @@ -125,4 +125,4 @@ exprList atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 50, 263, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 3, 2, 3, 2, 7, 2, 47, 10, 2, 12, 2, 14, 2, 50, 11, 2, 3, 3, 3, 3, 5, 3, 54, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 62, 10, 4, 3, 4, 3, 4, 5, 4, 66, 10, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 74, 10, 5, 3, 5, 3, 5, 5, 5, 78, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 84, 10, 6, 3, 6, 3, 6, 5, 6, 88, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 102, 10, 8, 3, 9, 7, 9, 105, 10, 9, 12, 9, 14, 9, 108, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 5, 11, 117, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 7, 12, 124, 10, 12, 12, 12, 14, 12, 127, 11, 12, 3, 13, 3, 13, 5, 13, 131, 10, 13, 3, 14, 3, 14, 7, 14, 135, 10, 14, 12, 14, 14, 14, 138, 11, 14, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 144, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 151, 10, 16, 12, 16, 14, 16, 154, 11, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 169, 10, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 185, 10, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 203, 10, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 222, 10, 21, 3, 21, 3, 21, 3, 21, 5, 21, 227, 10, 21, 3, 21, 3, 21, 3, 21, 5, 21, 232, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 250, 10, 21, 12, 21, 14, 21, 253, 11, 21, 3, 22, 3, 22, 3, 22, 7, 22, 258, 10, 22, 12, 22, 14, 22, 261, 11, 22, 3, 22, 3, 106, 3, 40, 23, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 2, 4, 4, 2, 15, 19, 48, 48, 5, 2, 4, 4, 28, 28, 31, 31, 2, 288, 2, 48, 3, 2, 2, 2, 4, 51, 3, 2, 2, 2, 6, 55, 3, 2, 2, 2, 8, 69, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 89, 3, 2, 2, 2, 14, 101, 3, 2, 2, 2, 16, 106, 3, 2, 2, 2, 18, 109, 3, 2, 2, 2, 20, 113, 3, 2, 2, 2, 22, 120, 3, 2, 2, 2, 24, 130, 3, 2, 2, 2, 26, 132, 3, 2, 2, 2, 28, 141, 3, 2, 2, 2, 30, 147, 3, 2, 2, 2, 32, 155, 3, 2, 2, 2, 34, 202, 3, 2, 2, 2, 36, 204, 3, 2, 2, 2, 38, 206, 3, 2, 2, 2, 40, 231, 3, 2, 2, 2, 42, 254, 3, 2, 2, 2, 44, 47, 5, 34, 18, 2, 45, 47, 7, 46, 2, 2, 46, 44, 3, 2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 50, 3, 2, 2, 2, 48, 46, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 3, 3, 2, 2, 2, 50, 48, 3, 2, 2, 2, 51, 53, 7, 48, 2, 2, 52, 54, 5, 28, 15, 2, 53, 52, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 5, 3, 2, 2, 2, 55, 56, 7, 7, 2, 2, 56, 61, 7, 48, 2, 2, 57, 58, 7, 31, 2, 2, 58, 59, 5, 12, 7, 2, 59, 60, 7, 4, 2, 2, 60, 62, 3, 2, 2, 2, 61, 57, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 65, 7, 34, 2, 2, 64, 66, 5, 22, 12, 2, 65, 64, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 67, 3, 2, 2, 2, 67, 68, 7, 35, 2, 2, 68, 7, 3, 2, 2, 2, 69, 70, 7, 8, 2, 2, 70, 73, 7, 48, 2, 2, 71, 72, 7, 22, 2, 2, 72, 74, 5, 12, 7, 2, 73, 71, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 77, 3, 2, 2, 2, 75, 76, 7, 3, 2, 2, 76, 78, 5, 40, 21, 2, 77, 75, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 9, 3, 2, 2, 2, 79, 80, 7, 9, 2, 2, 80, 83, 7, 48, 2, 2, 81, 82, 7, 22, 2, 2, 82, 84, 5, 12, 7, 2, 83, 81, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 87, 3, 2, 2, 2, 85, 86, 7, 3, 2, 2, 86, 88, 5, 40, 21, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 11, 3, 2, 2, 2, 89, 90, 9, 2, 2, 2, 90, 13, 3, 2, 2, 2, 91, 92, 7, 20, 2, 2, 92, 93, 7, 34, 2, 2, 93, 94, 7, 48, 2, 2, 94, 95, 7, 24, 2, 2, 95, 96, 5, 16, 9, 2, 96, 97, 7, 35, 2, 2, 97, 102, 3, 2, 2, 2, 98, 99, 7, 48, 2, 2, 99, 100, 7, 33, 2, 2, 100, 102, 5, 16, 9, 2, 101, 91, 3, 2, 2, 2, 101, 98, 3, 2, 2, 2, 102, 15, 3, 2, 2, 2, 103, 105, 11, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 108, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 107, 17, 3, 2, 2, 2, 108, 106, 3, 2, 2, 2, 109, 110, 7, 48, 2, 2, 110, 111, 7, 43, 2, 2, 111, 112, 5, 20, 11, 2, 112, 19, 3, 2, 2, 2, 113, 114, 7, 48, 2, 2, 114, 116, 7, 34, 2, 2, 115, 117, 5, 22, 12, 2, 116, 115, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 119, 7, 35, 2, 2, 119, 21, 3, 2, 2, 2, 120, 125, 5, 24, 13, 2, 121, 122, 7, 24, 2, 2, 122, 124, 5, 24, 13, 2, 123, 121, 3, 2, 2, 2, 124, 127, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 23, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 128, 131, 5, 40, 21, 2, 129, 131, 5, 14, 8, 2, 130, 128, 3, 2, 2, 2, 130, 129, 3, 2, 2, 2, 131, 25, 3, 2, 2, 2, 132, 136, 7, 38, 2, 2, 133, 135, 5, 34, 18, 2, 134, 133, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 139, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 140, 7, 39, 2, 2, 140, 27, 3, 2, 2, 2, 141, 143, 7, 38, 2, 2, 142, 144, 5, 30, 16, 2, 143, 142, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 7, 39, 2, 2, 146, 29, 3, 2, 2, 2, 147, 152, 5, 32, 17, 2, 148, 149, 7, 24, 2, 2, 149, 151, 5, 32, 17, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 31, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 156, 7, 48, 2, 2, 156, 157, 7, 22, 2, 2, 157, 158, 5, 40, 21, 2, 158, 33, 3, 2, 2, 2, 159, 160, 5, 4, 3, 2, 160, 161, 7, 23, 2, 2, 161, 203, 3, 2, 2, 2, 162, 163, 7, 10, 2, 2, 163, 164, 5, 40, 21, 2, 164, 165, 7, 11, 2, 2, 165, 168, 5, 36, 19, 2, 166, 167, 7, 12, 2, 2, 167, 169, 5, 38, 20, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 203, 3, 2, 2, 2, 170, 171, 7, 13, 2, 2, 171, 172, 7, 34, 2, 2, 172, 173, 7, 48, 2, 2, 173, 174, 7, 3, 2, 2, 174, 175, 5, 40, 21, 2, 175, 176, 7, 23, 2, 2, 176, 177, 5, 40, 21, 2, 177, 178, 7, 23, 2, 2, 178, 179, 5, 40, 21, 2, 179, 180, 7, 35, 2, 2, 180, 181, 5, 34, 18, 2, 181, 203, 3, 2, 2, 2, 182, 184, 7, 14, 2, 2, 183, 185, 5, 40, 21, 2, 184, 183, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 203, 7, 23, 2, 2, 187, 203, 5, 26, 14, 2, 188, 189, 5, 8, 5, 2, 189, 190, 7, 23, 2, 2, 190, 203, 3, 2, 2, 2, 191, 192, 5, 10, 6, 2, 192, 193, 7, 23, 2, 2, 193, 203, 3, 2, 2, 2, 194, 195, 5, 40, 21, 2, 195, 196, 7, 3, 2, 2, 196, 197, 5, 40, 21, 2, 197, 198, 7, 23, 2, 2, 198, 203, 3, 2, 2, 2, 199, 200, 5, 40, 21, 2, 200, 201, 7, 23, 2, 2, 201, 203, 3, 2, 2, 2, 202, 159, 3, 2, 2, 2, 202, 162, 3, 2, 2, 2, 202, 170, 3, 2, 2, 2, 202, 182, 3, 2, 2, 2, 202, 187, 3, 2, 2, 2, 202, 188, 3, 2, 2, 2, 202, 191, 3, 2, 2, 2, 202, 194, 3, 2, 2, 2, 202, 199, 3, 2, 2, 2, 203, 35, 3, 2, 2, 2, 204, 205, 5, 34, 18, 2, 205, 37, 3, 2, 2, 2, 206, 207, 5, 34, 18, 2, 207, 39, 3, 2, 2, 2, 208, 209, 8, 21, 1, 2, 209, 232, 5, 20, 11, 2, 210, 232, 5, 4, 3, 2, 211, 232, 5, 6, 4, 2, 212, 213, 7, 26, 2, 2, 213, 232, 5, 40, 21, 15, 214, 215, 7, 40, 2, 2, 215, 232, 5, 40, 21, 14, 216, 232, 7, 47, 2, 2, 217, 232, 7, 44, 2, 2, 218, 232, 7, 45, 2, 2, 219, 221, 7, 34, 2, 2, 220, 222, 5, 42, 22, 2, 221, 220, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 232, 7, 35, 2, 2, 224, 226, 7, 36, 2, 2, 225, 227, 5, 42, 22, 2, 226, 225, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 232, 7, 37, 2, 2, 229, 232, 5, 18, 10, 2, 230, 232, 7, 48, 2, 2, 231, 208, 3, 2, 2, 2, 231, 210, 3, 2, 2, 2, 231, 211, 3, 2, 2, 2, 231, 212, 3, 2, 2, 2, 231, 214, 3, 2, 2, 2, 231, 216, 3, 2, 2, 2, 231, 217, 3, 2, 2, 2, 231, 218, 3, 2, 2, 2, 231, 219, 3, 2, 2, 2, 231, 224, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 230, 3, 2, 2, 2, 232, 251, 3, 2, 2, 2, 233, 234, 12, 13, 2, 2, 234, 235, 7, 27, 2, 2, 235, 250, 5, 40, 21, 14, 236, 237, 12, 12, 2, 2, 237, 238, 7, 25, 2, 2, 238, 250, 5, 40, 21, 13, 239, 240, 12, 11, 2, 2, 240, 241, 7, 26, 2, 2, 241, 250, 5, 40, 21, 12, 242, 243, 12, 10, 2, 2, 243, 244, 9, 3, 2, 2, 244, 250, 5, 40, 21, 11, 245, 246, 12, 17, 2, 2, 246, 250, 7, 5, 2, 2, 247, 248, 12, 16, 2, 2, 248, 250, 7, 6, 2, 2, 249, 233, 3, 2, 2, 2, 249, 236, 3, 2, 2, 2, 249, 239, 3, 2, 2, 2, 249, 242, 3, 2, 2, 2, 249, 245, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 250, 253, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 41, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 254, 259, 5, 40, 21, 2, 255, 256, 7, 24, 2, 2, 256, 258, 5, 40, 21, 2, 257, 255, 3, 2, 2, 2, 258, 261, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 43, 3, 2, 2, 2, 261, 259, 3, 2, 2, 2, 28, 46, 48, 53, 61, 65, 73, 77, 83, 87, 101, 106, 116, 125, 130, 136, 143, 152, 168, 184, 202, 221, 226, 231, 249, 251, 259] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 50, 264, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 3, 2, 3, 2, 7, 2, 47, 10, 2, 12, 2, 14, 2, 50, 11, 2, 3, 3, 3, 3, 5, 3, 54, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 62, 10, 4, 3, 4, 3, 4, 5, 4, 66, 10, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 74, 10, 5, 3, 5, 3, 5, 5, 5, 78, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 84, 10, 6, 3, 6, 3, 6, 5, 6, 88, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 102, 10, 8, 3, 9, 7, 9, 105, 10, 9, 12, 9, 14, 9, 108, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 5, 11, 117, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 7, 12, 124, 10, 12, 12, 12, 14, 12, 127, 11, 12, 3, 13, 3, 13, 5, 13, 131, 10, 13, 3, 14, 3, 14, 7, 14, 135, 10, 14, 12, 14, 14, 14, 138, 11, 14, 3, 14, 3, 14, 3, 15, 3, 15, 5, 15, 144, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 151, 10, 16, 12, 16, 14, 16, 154, 11, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 169, 10, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 185, 10, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 203, 10, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 223, 10, 21, 3, 21, 3, 21, 3, 21, 5, 21, 228, 10, 21, 3, 21, 3, 21, 3, 21, 5, 21, 233, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 251, 10, 21, 12, 21, 14, 21, 254, 11, 21, 3, 22, 3, 22, 3, 22, 7, 22, 259, 10, 22, 12, 22, 14, 22, 262, 11, 22, 3, 22, 3, 106, 3, 40, 23, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 2, 4, 4, 2, 15, 19, 48, 48, 4, 2, 4, 4, 28, 32, 2, 290, 2, 48, 3, 2, 2, 2, 4, 51, 3, 2, 2, 2, 6, 55, 3, 2, 2, 2, 8, 69, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 89, 3, 2, 2, 2, 14, 101, 3, 2, 2, 2, 16, 106, 3, 2, 2, 2, 18, 109, 3, 2, 2, 2, 20, 113, 3, 2, 2, 2, 22, 120, 3, 2, 2, 2, 24, 130, 3, 2, 2, 2, 26, 132, 3, 2, 2, 2, 28, 141, 3, 2, 2, 2, 30, 147, 3, 2, 2, 2, 32, 155, 3, 2, 2, 2, 34, 202, 3, 2, 2, 2, 36, 204, 3, 2, 2, 2, 38, 206, 3, 2, 2, 2, 40, 232, 3, 2, 2, 2, 42, 255, 3, 2, 2, 2, 44, 47, 5, 34, 18, 2, 45, 47, 7, 46, 2, 2, 46, 44, 3, 2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 50, 3, 2, 2, 2, 48, 46, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 3, 3, 2, 2, 2, 50, 48, 3, 2, 2, 2, 51, 53, 7, 48, 2, 2, 52, 54, 5, 28, 15, 2, 53, 52, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 5, 3, 2, 2, 2, 55, 56, 7, 7, 2, 2, 56, 61, 7, 48, 2, 2, 57, 58, 7, 31, 2, 2, 58, 59, 5, 12, 7, 2, 59, 60, 7, 4, 2, 2, 60, 62, 3, 2, 2, 2, 61, 57, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 65, 7, 34, 2, 2, 64, 66, 5, 22, 12, 2, 65, 64, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 67, 3, 2, 2, 2, 67, 68, 7, 35, 2, 2, 68, 7, 3, 2, 2, 2, 69, 70, 7, 8, 2, 2, 70, 73, 7, 48, 2, 2, 71, 72, 7, 22, 2, 2, 72, 74, 5, 12, 7, 2, 73, 71, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 77, 3, 2, 2, 2, 75, 76, 7, 3, 2, 2, 76, 78, 5, 40, 21, 2, 77, 75, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 9, 3, 2, 2, 2, 79, 80, 7, 9, 2, 2, 80, 83, 7, 48, 2, 2, 81, 82, 7, 22, 2, 2, 82, 84, 5, 12, 7, 2, 83, 81, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 87, 3, 2, 2, 2, 85, 86, 7, 3, 2, 2, 86, 88, 5, 40, 21, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 11, 3, 2, 2, 2, 89, 90, 9, 2, 2, 2, 90, 13, 3, 2, 2, 2, 91, 92, 7, 20, 2, 2, 92, 93, 7, 34, 2, 2, 93, 94, 7, 48, 2, 2, 94, 95, 7, 24, 2, 2, 95, 96, 5, 16, 9, 2, 96, 97, 7, 35, 2, 2, 97, 102, 3, 2, 2, 2, 98, 99, 7, 48, 2, 2, 99, 100, 7, 33, 2, 2, 100, 102, 5, 16, 9, 2, 101, 91, 3, 2, 2, 2, 101, 98, 3, 2, 2, 2, 102, 15, 3, 2, 2, 2, 103, 105, 11, 2, 2, 2, 104, 103, 3, 2, 2, 2, 105, 108, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 107, 17, 3, 2, 2, 2, 108, 106, 3, 2, 2, 2, 109, 110, 7, 48, 2, 2, 110, 111, 7, 43, 2, 2, 111, 112, 5, 20, 11, 2, 112, 19, 3, 2, 2, 2, 113, 114, 7, 48, 2, 2, 114, 116, 7, 34, 2, 2, 115, 117, 5, 22, 12, 2, 116, 115, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 119, 7, 35, 2, 2, 119, 21, 3, 2, 2, 2, 120, 125, 5, 24, 13, 2, 121, 122, 7, 24, 2, 2, 122, 124, 5, 24, 13, 2, 123, 121, 3, 2, 2, 2, 124, 127, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 23, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 128, 131, 5, 40, 21, 2, 129, 131, 5, 14, 8, 2, 130, 128, 3, 2, 2, 2, 130, 129, 3, 2, 2, 2, 131, 25, 3, 2, 2, 2, 132, 136, 7, 38, 2, 2, 133, 135, 5, 34, 18, 2, 134, 133, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 139, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 140, 7, 39, 2, 2, 140, 27, 3, 2, 2, 2, 141, 143, 7, 38, 2, 2, 142, 144, 5, 30, 16, 2, 143, 142, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 7, 39, 2, 2, 146, 29, 3, 2, 2, 2, 147, 152, 5, 32, 17, 2, 148, 149, 7, 24, 2, 2, 149, 151, 5, 32, 17, 2, 150, 148, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 31, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 156, 7, 48, 2, 2, 156, 157, 7, 22, 2, 2, 157, 158, 5, 40, 21, 2, 158, 33, 3, 2, 2, 2, 159, 160, 5, 4, 3, 2, 160, 161, 7, 23, 2, 2, 161, 203, 3, 2, 2, 2, 162, 163, 7, 10, 2, 2, 163, 164, 5, 40, 21, 2, 164, 165, 7, 11, 2, 2, 165, 168, 5, 36, 19, 2, 166, 167, 7, 12, 2, 2, 167, 169, 5, 38, 20, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 203, 3, 2, 2, 2, 170, 171, 7, 13, 2, 2, 171, 172, 7, 34, 2, 2, 172, 173, 7, 48, 2, 2, 173, 174, 7, 3, 2, 2, 174, 175, 5, 40, 21, 2, 175, 176, 7, 23, 2, 2, 176, 177, 5, 40, 21, 2, 177, 178, 7, 23, 2, 2, 178, 179, 5, 40, 21, 2, 179, 180, 7, 35, 2, 2, 180, 181, 5, 34, 18, 2, 181, 203, 3, 2, 2, 2, 182, 184, 7, 14, 2, 2, 183, 185, 5, 40, 21, 2, 184, 183, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 203, 7, 23, 2, 2, 187, 203, 5, 26, 14, 2, 188, 189, 5, 8, 5, 2, 189, 190, 7, 23, 2, 2, 190, 203, 3, 2, 2, 2, 191, 192, 5, 10, 6, 2, 192, 193, 7, 23, 2, 2, 193, 203, 3, 2, 2, 2, 194, 195, 5, 40, 21, 2, 195, 196, 7, 3, 2, 2, 196, 197, 5, 40, 21, 2, 197, 198, 7, 23, 2, 2, 198, 203, 3, 2, 2, 2, 199, 200, 5, 40, 21, 2, 200, 201, 7, 23, 2, 2, 201, 203, 3, 2, 2, 2, 202, 159, 3, 2, 2, 2, 202, 162, 3, 2, 2, 2, 202, 170, 3, 2, 2, 2, 202, 182, 3, 2, 2, 2, 202, 187, 3, 2, 2, 2, 202, 188, 3, 2, 2, 2, 202, 191, 3, 2, 2, 2, 202, 194, 3, 2, 2, 2, 202, 199, 3, 2, 2, 2, 203, 35, 3, 2, 2, 2, 204, 205, 5, 34, 18, 2, 205, 37, 3, 2, 2, 2, 206, 207, 5, 34, 18, 2, 207, 39, 3, 2, 2, 2, 208, 209, 8, 21, 1, 2, 209, 233, 5, 20, 11, 2, 210, 233, 5, 14, 8, 2, 211, 233, 5, 4, 3, 2, 212, 233, 5, 6, 4, 2, 213, 214, 7, 26, 2, 2, 214, 233, 5, 40, 21, 15, 215, 216, 7, 40, 2, 2, 216, 233, 5, 40, 21, 14, 217, 233, 7, 47, 2, 2, 218, 233, 7, 44, 2, 2, 219, 233, 7, 45, 2, 2, 220, 222, 7, 34, 2, 2, 221, 223, 5, 42, 22, 2, 222, 221, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 233, 7, 35, 2, 2, 225, 227, 7, 36, 2, 2, 226, 228, 5, 42, 22, 2, 227, 226, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 233, 7, 37, 2, 2, 230, 233, 5, 18, 10, 2, 231, 233, 7, 48, 2, 2, 232, 208, 3, 2, 2, 2, 232, 210, 3, 2, 2, 2, 232, 211, 3, 2, 2, 2, 232, 212, 3, 2, 2, 2, 232, 213, 3, 2, 2, 2, 232, 215, 3, 2, 2, 2, 232, 217, 3, 2, 2, 2, 232, 218, 3, 2, 2, 2, 232, 219, 3, 2, 2, 2, 232, 220, 3, 2, 2, 2, 232, 225, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 232, 231, 3, 2, 2, 2, 233, 252, 3, 2, 2, 2, 234, 235, 12, 13, 2, 2, 235, 236, 7, 27, 2, 2, 236, 251, 5, 40, 21, 14, 237, 238, 12, 12, 2, 2, 238, 239, 7, 25, 2, 2, 239, 251, 5, 40, 21, 13, 240, 241, 12, 11, 2, 2, 241, 242, 7, 26, 2, 2, 242, 251, 5, 40, 21, 12, 243, 244, 12, 10, 2, 2, 244, 245, 9, 3, 2, 2, 245, 251, 5, 40, 21, 11, 246, 247, 12, 17, 2, 2, 247, 251, 7, 5, 2, 2, 248, 249, 12, 16, 2, 2, 249, 251, 7, 6, 2, 2, 250, 234, 3, 2, 2, 2, 250, 237, 3, 2, 2, 2, 250, 240, 3, 2, 2, 2, 250, 243, 3, 2, 2, 2, 250, 246, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 41, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 260, 5, 40, 21, 2, 256, 257, 7, 24, 2, 2, 257, 259, 5, 40, 21, 2, 258, 256, 3, 2, 2, 2, 259, 262, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 43, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 28, 46, 48, 53, 61, 65, 73, 77, 83, 87, 101, 106, 116, 125, 130, 136, 143, 152, 168, 184, 202, 222, 227, 232, 250, 252, 260] \ No newline at end of file diff --git a/src/dsl/Elsa.Dsl/Abstractions/ElsaParserBaseVisitor.cs b/src/dsl/Elsa.Dsl/Abstractions/ElsaParserBaseVisitor.cs index daadb2ca9..87cb57bf0 100644 --- a/src/dsl/Elsa.Dsl/Abstractions/ElsaParserBaseVisitor.cs +++ b/src/dsl/Elsa.Dsl/Abstractions/ElsaParserBaseVisitor.cs @@ -479,6 +479,17 @@ public partial class ElsaParserBaseVisitor : AbstractParseTreeVisitorThe visitor result. public virtual Result VisitAddExpr([NotNull] ElsaParser.AddExprContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by the expressionMarkerExpr + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitExpressionMarkerExpr([NotNull] ElsaParser.ExpressionMarkerExprContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by the backTickStringValueExpr /// labeled alternative in . /// diff --git a/src/dsl/Elsa.Dsl/Abstractions/ElsaParserVisitor.cs b/src/dsl/Elsa.Dsl/Abstractions/ElsaParserVisitor.cs index 1eb1bbd35..7530204f4 100644 --- a/src/dsl/Elsa.Dsl/Abstractions/ElsaParserVisitor.cs +++ b/src/dsl/Elsa.Dsl/Abstractions/ElsaParserVisitor.cs @@ -308,6 +308,13 @@ public interface IElsaParserVisitor : IParseTreeVisitor { /// The visitor result. Result VisitAddExpr([NotNull] ElsaParser.AddExprContext context); /// + /// Visit a parse tree produced by the expressionMarkerExpr + /// labeled alternative in . + /// + /// The parse tree. + /// The visitor result. + Result VisitExpressionMarkerExpr([NotNull] ElsaParser.ExpressionMarkerExprContext context); + /// /// Visit a parse tree produced by the backTickStringValueExpr /// labeled alternative in . /// diff --git a/src/dsl/Elsa.Dsl/Dsl/ElsaParser.g4 b/src/dsl/Elsa.Dsl/Dsl/ElsaParser.g4 index f01366c1d..4c5e0c86c 100644 --- a/src/dsl/Elsa.Dsl/Dsl/ElsaParser.g4 +++ b/src/dsl/Elsa.Dsl/Dsl/ElsaParser.g4 @@ -94,24 +94,25 @@ elseStat ; expr - : funcCall #functionExpr - | object #objectExpr - | newObject #newObjectExpr - | expr '++' #incrementExpr - | expr '--' #decrementExpr - | '-' expr #negateExpr - | '!' expr #notExpr - | expr '*' expr #multiplyExpr - | expr '+' expr #addExpr - | expr '-' expr #subtractExpr - | expr ('==' | '>' | '<') expr #compareExpr - | INTEGER_VAL #integerValueExpr - | STRING_VAL #stringValueExpr - | BACKTICKSTRING_VAL #backTickStringValueExpr - | '(' exprList? ')' #parenthesesExpr - | '[' exprList? ']' #bracketsExpr - | methodCall #methodCallExpr - | ID #variableExpr + : funcCall #functionExpr + | expressionMarker #expressionMarkerExpr + | object #objectExpr + | newObject #newObjectExpr + | expr '++' #incrementExpr + | expr '--' #decrementExpr + | '-' expr #negateExpr + | '!' expr #notExpr + | expr '*' expr #multiplyExpr + | expr '+' expr #addExpr + | expr '-' expr #subtractExpr + | expr ('==' | '>' | '<' | '!=' | '>=' | '<=') expr #compareExpr + | INTEGER_VAL #integerValueExpr + | STRING_VAL #stringValueExpr + | BACKTICKSTRING_VAL #backTickStringValueExpr + | '(' exprList? ')' #parenthesesExpr + | '[' exprList? ']' #bracketsExpr + | methodCall #methodCallExpr + | ID #variableExpr ; exprList diff --git a/src/dsl/Elsa.Dsl/Dsl/Samples/If.elsa b/src/dsl/Elsa.Dsl/Dsl/Samples/If.elsa index 937f01963..81b12c0b9 100644 --- a/src/dsl/Elsa.Dsl/Dsl/Samples/If.elsa +++ b/src/dsl/Elsa.Dsl/Dsl/Samples/If.elsa @@ -1,7 +1,7 @@ print("What's your age?"); variable age = ReadLine; -if(age > 16) +if age > 16 then { print("Enjoy your driver's license!"); // delay(5000); diff --git a/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitExternalExpression.cs b/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitExternalExpression.cs index 97d29b0b6..093e9fd2e 100644 --- a/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitExternalExpression.cs +++ b/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitExternalExpression.cs @@ -16,6 +16,7 @@ public partial class WorkflowDefinitionBuilderInterpreter var expressionReference = new JavaScriptExpressionReference(expression); var externalReference = new ExternalExpressionReference(expression, expressionReference); _expressionValue.Put(context, externalReference); + _expressionValue.Put(context.Parent, externalReference); return DefaultResult; } diff --git a/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitProperty.cs b/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitProperty.cs index 600f903a0..0f5310a28 100644 --- a/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitProperty.cs +++ b/src/dsl/Elsa.Dsl/Interpreters/WorkflowDefinitionBuilderInterpreter/VisitProperty.cs @@ -50,8 +50,8 @@ public partial class WorkflowDefinitionBuilderInterpreter return (Input)Activator.CreateInstance(inputType, propertyValue)!; } - var convertedValue = propertyValue.ConvertTo(underlyingType); - - return (Input)Activator.CreateInstance(inputType, convertedValue)!; + return propertyValue is ExternalExpressionReference externalExpressionReference + ? (Input)Activator.CreateInstance(inputType, externalExpressionReference.Expression, externalExpressionReference.Reference)! + : (Input)Activator.CreateInstance(inputType, propertyValue.ConvertTo(underlyingType))!; } } \ No newline at end of file diff --git a/src/samples/console/Elsa.Samples.Console2/Demo1.elsa b/src/samples/console/Elsa.Samples.Console2/Demo1.elsa new file mode 100644 index 000000000..f5199fa85 --- /dev/null +++ b/src/samples/console/Elsa.Samples.Console2/Demo1.elsa @@ -0,0 +1 @@ +WriteLine { Text:"Hello World!" }; \ No newline at end of file diff --git a/src/samples/console/Elsa.Samples.Console2/Demo2.elsa b/src/samples/console/Elsa.Samples.Console2/Demo2.elsa new file mode 100644 index 000000000..bfcf6b0ed --- /dev/null +++ b/src/samples/console/Elsa.Samples.Console2/Demo2.elsa @@ -0,0 +1,14 @@ +//let name: Variable; +let readLine1 = ReadLine; + +Sequence { + Activities: [ + WriteLine { Text: "Please Enter your name" }, + Sequence { + Activities: [ + readLine1, + WriteLine { Text: js => `Hello ${readline1}` } + ] + } + ] +}; \ No newline at end of file diff --git a/src/samples/console/Elsa.Samples.Console2/Demo3.elsa b/src/samples/console/Elsa.Samples.Console2/Demo3.elsa new file mode 100644 index 000000000..dfe80e8de --- /dev/null +++ b/src/samples/console/Elsa.Samples.Console2/Demo3.elsa @@ -0,0 +1 @@ +print("Hello World"); \ No newline at end of file diff --git a/src/samples/console/Elsa.Samples.Console2/Demo4.elsa b/src/samples/console/Elsa.Samples.Console2/Demo4.elsa new file mode 100644 index 000000000..86355ee21 --- /dev/null +++ b/src/samples/console/Elsa.Samples.Console2/Demo4.elsa @@ -0,0 +1,16 @@ +// Print a message. +print("What's your age?"); + +// Declare a workflow variable and assign the result of the ReadLine activity. +variable age = ReadLine; // Could also use the mapped function called `read()`. + +// The `if` keyword is mapped to the If activity. The condition requires a JavaScript expression. +if age >= 18 then +{ + print("Enjoy your driver's license!"); + print("But be careful!"); +} +else + print("Enjoy your bicycle!"); + +print("Goodbye."); \ No newline at end of file diff --git a/src/samples/console/Elsa.Samples.Console2/Elsa.Samples.Console2.csproj b/src/samples/console/Elsa.Samples.Console2/Elsa.Samples.Console2.csproj index f5e00f4c0..4fdc36ecf 100644 --- a/src/samples/console/Elsa.Samples.Console2/Elsa.Samples.Console2.csproj +++ b/src/samples/console/Elsa.Samples.Console2/Elsa.Samples.Console2.csproj @@ -24,6 +24,10 @@ + + + + diff --git a/src/samples/console/Elsa.Samples.Console2/Program.cs b/src/samples/console/Elsa.Samples.Console2/Program.cs index e676801ce..f63919618 100644 --- a/src/samples/console/Elsa.Samples.Console2/Program.cs +++ b/src/samples/console/Elsa.Samples.Console2/Program.cs @@ -21,6 +21,7 @@ var typeSystem = serviceProvider.GetRequiredService(); var dslEngine = serviceProvider.GetRequiredService(); var functionActivityRegistry = serviceProvider.GetRequiredService(); +// Map .NET types to Elsa DSL. Optionally using an alias. typeSystem.Register("int"); typeSystem.Register("float"); typeSystem.Register("string"); @@ -31,15 +32,21 @@ typeSystem.Register(); typeSystem.Register(); typeSystem.Register(); +// Map functions to activities. functionActivityRegistry.RegisterFunction("print", nameof(WriteLine), new[] { nameof(WriteLine.Text) }); functionActivityRegistry.RegisterFunction("read", nameof(ReadLine), new[] { nameof(ReadLine.Result) }); var assembly = Assembly.GetExecutingAssembly(); -var resource = assembly.GetManifestResourceStream("Elsa.Samples.Console2.Sample1.elsa"); +// Read text file containing Elsa DSL. +var scriptName = "Demo2"; +var resource = assembly.GetManifestResourceStream($"Elsa.Samples.Console2.{scriptName}.elsa"); var script = await new StreamReader(resource!).ReadToEndAsync(); + +// Evaluate the DSL. The result will be an executable workflow definition. var workflowDefinition = dslEngine.Parse(script); +// Run the workflow. var workflowEngine = serviceProvider.GetRequiredService(); await workflowEngine.RunAsync(workflowDefinition); diff --git a/src/samples/console/Elsa.Samples.Console2/Sample1.elsa b/src/samples/console/Elsa.Samples.Console2/Sample1.elsa index 937f01963..81b12c0b9 100644 --- a/src/samples/console/Elsa.Samples.Console2/Sample1.elsa +++ b/src/samples/console/Elsa.Samples.Console2/Sample1.elsa @@ -1,7 +1,7 @@ print("What's your age?"); variable age = ReadLine; -if(age > 16) +if age > 16 then { print("Enjoy your driver's license!"); // delay(5000);