Esempio n. 1
0
        /// <summary>
        /// action_declaration_statement :
        ///     ACTION key LEFT_PAREN parameters? RIGHT_PAREN comment?
        ///     ;
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override object VisitAction_declaration_statement([NotNull] WorkflowParser.Action_declaration_statementContext context)
        {
            var key = (string)VisitKey(context.key());

            string comment = string.Empty;
            var    c       = context.comment();

            if (c != null)
            {
                comment = (string)Visit(c);
            }

            if (!this._actions.TryGetValue(key, out MethodReference r))
            {
                this._actions.Add(key, r = new MethodReference()
                {
                    Name = key, Comment = comment
                });
            }
            else
            {
                throw new Exceptions.DuplicatedArgumentNameMethodReferenceException("Action method name" + key);
            }

            var p = context.parameters();

            if (p != null)
            {
                var h = (Dictionary <string, Type>)VisitParameters(p);
                foreach (var item in h)
                {
                    r.Arguments.Add(item.Key, item.Value);
                }
            }

            return(r);
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="WorkflowParser.action_declaration_statement"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitAction_declaration_statement([NotNull] WorkflowParser.Action_declaration_statementContext context)
 {
     return(VisitChildren(context));
 }
 /// <summary>
 /// action_declaration_statement :
 ///     ACTION key LEFT_PAREN parameters? RIGHT_PAREN comment?
 ///     ;
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public override object VisitAction_declaration_statement([NotNull] WorkflowParser.Action_declaration_statementContext context)
 {
     return(base.VisitAction_declaration_statement(context));
 }