private static void DumpLexicalAnalyzer_GetSymbol(
            RegulationList grammar, CodeTypeDeclaration lexiType,
            string grammarId, SyntaxParserMapAlgorithm algorithm)
        {
            List <LexiState> lexiStateList = grammar.GetLexiStateList();
            DivideState      commentState  = null;// 为了处理注释,"/"符号要特殊对待。

            foreach (var state in lexiStateList)
            {
                if (state.CharTypeList.Contains(SourceCodeCharType.Divide))
                {
                    commentState = new DivideState(state);
                    continue;
                }

                CodeMemberMethod method = state.GetMethodDefinitionStatement(grammarId, algorithm);
                if (method != null)
                {
                    lexiType.Members.Add(method);
                }
            }
            {
                if (commentState == null)
                {
                    commentState = LexiState.GetCommentState();
                }
                CodeMemberMethod method = commentState.GetMethodDefinitionStatement(grammarId, algorithm);
                if (method != null)
                {
                    lexiType.Members.Add(method);
                }
            }
        }
        private static void DumpLexicalAnalyzer_TryGetToken(
            RegulationList grammar, CodeTypeDeclaration lexiType)
        {
            var method = new CodeMemberMethod();

            method.Name       = "TryGetToken";
            method.Attributes = MemberAttributes.Family | MemberAttributes.Override;
            method.ReturnType = new CodeTypeReference(typeof(bool));
            method.Parameters.Add(new CodeParameterDeclarationExpression("AnalyzingContext", "context"));
            method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(Token), "result"));
            method.Parameters.Add(new CodeParameterDeclarationExpression("SourceCodeCharType", "charType"));
            {
                // bool gotToken = false;
                string vargotToken    = "gotToken"; // :(
                var    varDeclaration = new CodeVariableDeclarationStatement(typeof(bool), vargotToken);
                varDeclaration.InitExpression = new CodePrimitiveExpression(false);
                method.Statements.Add(varDeclaration);
            }
            {
                List <LexiState> lexiStateList = grammar.GetLexiStateList();
                DivideState      commentState  = null;// 为了处理注释,"/"符号要特殊对待。
                foreach (var state in lexiStateList)
                {
                    if (state.CharTypeList.Contains(SourceCodeCharType.Divide))
                    {
                        commentState = new DivideState(state);
                        continue;
                    }

                    var condition = new CodeConditionStatement(
                        state.GetCondition(),
                        state.GetMethodInvokeStatement());
                    method.Statements.Add(condition);
                }
                {
                    if (commentState == null)
                    {
                        commentState = LexiState.GetCommentState();
                    }
                    var condition = new CodeConditionStatement(
                        commentState.GetCondition(),
                        commentState.GetMethodInvokeStatement());
                    method.Statements.Add(condition);
                }
                {
                    var getSpaceState = LexiState.GetSpaceState();
                    var condition     = new CodeConditionStatement(
                        getSpaceState.GetCondition(),
                        getSpaceState.GetMethodInvokeStatement());
                    method.Statements.Add(condition);
                }
                {
                    var getUnknownState = LexiState.GetUnknownState();
                    var lastCondition   = getUnknownState.GetMethodInvokeStatement();
                    method.Statements.AddRange(lastCondition);
                }
            }

            lexiType.Members.Add(method);
        }