Ejemplo n.º 1
0
        public void CreateRGGTransition(string from, string to, TransitionType transitionType, params object[] args)
        {
            RGGNode fromNode = GetNode(from);

            if (transitionType == TransitionType.PatternStart)
            {
                if (!_patternStartRGGNodes.ContainsKey(from))
                {
                    _patternStartRGGNodes.Add(from, fromNode);
                }
            }
            RGGTransition transition = new RGGTransition(fromNode, GetNode(to), transitionType, args);
        }
Ejemplo n.º 2
0
        public bool PushTransition(TerminalPattern inputChar, out RGGTransition transition)
        {
            RGGTransition tempTransition;

            if (_pushTransitions.TryGetValue(inputChar.ToString(), out tempTransition))
            {
                transition = tempTransition;
                return(true);
            }
            else
            {
                transition = null;
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool PopTransition(string stackState, out RGGTransition transition)
        {
            RGGTransition tempTransition;

            if (_popTransitions.TryGetValue(stackState, out tempTransition))
            {
                transition = tempTransition;
                return(true);
            }
            else
            {
                transition = null;
                return(false);
            }
        }
Ejemplo n.º 4
0
        public void AddTransition(RGGTransition transition)
        {
            switch (transition.TransitionType)
            {
            case TransitionType.Pop:
                _popTransitions.Add(transition.To.Name, transition);
                break;

            case TransitionType.Push:
                _pushTransitions.Add(transition.Terminal.ToString(), transition);
                break;

            default:
                _otherTransitions.Add(transition);
                break;
            }
        }