示例#1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            SaveEntrada();

            TesteCScanner scanner = new TesteCScanner();

            scanner.SetInput(textEntrada.Text);
            bool ret = scanner.ProccessInput();

            Debug.WriteLine("--------------------------");
            foreach (TokenInfo token in scanner.Tokens)
            {
                Debug.WriteLine(String.Format(" Token:{0}", token));
            }
            Debug.WriteLine("--------------------------");
        }
示例#2
0
        private void buttonProcessarUmAUm_Click(object sender, EventArgs e)
        {
            SaveEntrada();

            TesteCScanner scanner = new TesteCScanner();

            scanner.SetInput(textEntrada.Text);
            scanner.Reset();
            Debug.WriteLine("--------------------------");
            while (true)
            {
                TokenInfo tok = scanner.GetToken();
                if (tok == null)
                {
                    break;
                }
                Debug.WriteLine(String.Format(" Token:{0}", tok));
            }
            Debug.WriteLine("LastState:    " + scanner.LastState);
            Debug.WriteLine("CurrentState: " + scanner.CurrentState);
            Debug.WriteLine("NextState:    " + scanner.NextState);
            Debug.WriteLine("FinalState:   " + scanner.FinalState);
            Debug.WriteLine("--------------------------");
        }