Пример #1
0
TParserNode *TParser::Expr4(NSGuidesOdp::CFormulaManager& pFManager)
{
   TParserNode *temp;

   if(typToken>=PARSER_SIN && typToken<=PARSER_ABS)
   {
      temp = CreateNode(OP_SIN-PARSER_SIN+typToken);
      GetToken();
      if(typToken!=PARSER_L_BRACKET) SendError(4);
      GetToken();
      temp->left = Expr(pFManager);
      if(typToken!=PARSER_R_BRACKET) SendError(5);
      GetToken();
   }
   else if((typToken >= PARSER_MIN) && (typToken <= PARSER_ATAN2))
   {
	   temp = CreateNode(OP_MIN-PARSER_MIN+typToken);
	   GetToken();
       if(typToken!=PARSER_L_BRACKET) SendError(4);
       GetToken();
       temp->left = Expr(pFManager);
	   if(typToken != PARSER_COMMA) SendError(6);
	   GetToken();
	   temp->right = Expr(pFManager);
       if(typToken!=PARSER_R_BRACKET) SendError(5);
       GetToken();
   }
   else if(typToken == PARSER_IF)
   {
	   temp = CreateNode(OP_IF);
	   GetToken();
       if(typToken!=PARSER_L_BRACKET) SendError(4);
       GetToken();
       temp->left = Expr(pFManager);
	   if(typToken != PARSER_COMMA) SendError(6);
	   GetToken();
	   temp->right = Expr(pFManager);
	   if(typToken != PARSER_COMMA) SendError(6);
	   GetToken();
	   temp->third = Expr(pFManager);
       if(typToken!=PARSER_R_BRACKET) SendError(5);
       GetToken();
   }
   else
      temp = Expr5(pFManager);

   return temp;
}
Пример #2
0
TParserNode *TParser::Expr4(void)
{
   TParserNode *temp;

   if(typToken>=PARSER_SIN && typToken<=PARSER_X)
   {
      temp = CreateNode(OP_SIN-PARSER_SIN+typToken);
      GetToken();
      if(typToken!=PARSER_L_BRACKET) SendError(4);
      GetToken();
      temp->left = Expr();
      if(typToken!=PARSER_R_BRACKET) SendError(5);
      GetToken();
   }
   else
      temp = Expr5();

   return temp;
}