示例#1
0
        //	Create as much of the parse tree as possible.
        public override int CreateParseSubTree(ref CLexicalAnalyzer plexAnal, ref CSymbolTable pSymbolTable)
        {
            CParserBuilder builder = new CParserBuilder();
            CGrammarNode   pStmt   = null;

            int i = 0;

            //try
            {
                while (true)
                {
                    i++;

                    if (i == 0xb)
                    {
                        ;
                    }

                    pStmt = builder.CreateParser(ref plexAnal, STATEMENT_TYPE.STMT_asic);
                    if (pStmt == null)
                    {
                        if (plexAnal.IsEndOfSource())
                        {
                            return(1);
                        }
                        else
                        {
                            CToken pToken = null;

                            if ((CLexicalAnalyzer.LEX_FAIL != plexAnal.GetNextToken(ref pToken, ref pSymbolTable)) && pToken != null)
                            {
                                if (pToken.GetSubType() == RUL_TOKEN_SUBTYPE.RUL_SEMICOLON)
                                {
                                    continue;
                                }
                                else
                                {
                                    plexAnal.UnGetToken();
                                }
                            }

                            return(0);
                        }
                    }
                    pStmt.SetScopeIndex(plexAnal.GetSymbolTableScopeIndex());         //SCR26200 Felix
                    m_stmtList.Add((CStatement)pStmt);
                    pStmt.CreateParseSubTree(ref plexAnal, ref pSymbolTable);
                }//end of while loop

                //return 1;
            }

            /*
             *          catch (...)
             *          {
             *                  return PARSE_FAIL;
             *          }
             */
        }