예제 #1
0
        public override object VisitTransitionDefinition(CdeltaParser.TransitionDefinitionContext context)
        {
            Transition transition = new Transition(null, null, null)
            {
                DesiredSourceState = context.IDENTIFIER(0).GetText(),
                DesiredTargetState = context.IDENTIFIER(1).GetText()
            };

            ((Automaton)contextWithStructure[context.Parent]).Transitions.Add(transition);
            contextWithStructure.Add(context, transition);

            return(base.VisitTransitionDefinition(context));
        }
예제 #2
0
        public override IEnumerable <StructureBase> VisitTransitionDefinition(CdeltaParser.TransitionDefinitionContext context)
        {
            var result = new Transition(context.IDENTIFIER(0).GetText(), context.IDENTIFIER(1).GetText());

            foreach (var child in base.VisitTransitionDefinition(context))
            {
                if (child is TransitionEnter enter)
                {
                    enter.Parent = result;
                    result.Enter = enter;
                }
            }

            yield return(result);
        }
예제 #3
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="CdeltaParser.transitionDefinition"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitTransitionDefinition([NotNull] CdeltaParser.TransitionDefinitionContext context)
 {
 }
예제 #4
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="CdeltaParser.transitionDefinition"/>.
 /// <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 VisitTransitionDefinition([NotNull] CdeltaParser.TransitionDefinitionContext context)
 {
     return(VisitChildren(context));
 }