コード例 #1
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void dec_body(rdp_tree_node_data* rdp_tree)
{
  char* name;
  {
    if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
    scan_test(NULL, SCAN_P_ID, &dec_body_stop);
    name = SCAN_CAST->id;
    scan_();
    if (scan_test(NULL, RDP_T_61 /* = */, NULL))
    { /* Start of rdp_dec_body_1 */
      while (1)
      {
        {
          scan_test(NULL, RDP_T_61 /* = */, &dec_body_stop);
          scan_();
          e0(rdp_add_child("e0", rdp_tree));
          }
        break;   /* hi limit is 1! */
      }
    } /* end of rdp_dec_body_1 */
    else
    {
      /* default action processing for rdp_dec_body_1*/
    }
     symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data)); \
                if (*name == '_' && *(name+1) == '_')\
                  text_message(TEXT_ERROR_ECHO, "variable names must not begin with two underscores\n");\
             
    scan_test_set(NULL, &dec_body_stop, &dec_body_stop);
   }
}
コード例 #2
0
static void e3(void)
{
  {
    if (scan_test_set(NULL, &rdp_e3_0_first, NULL))
    {
      e4();
    }
    else
    if (scan_test(NULL, RDP_T_43 /* + */, NULL))
    {
      scan_test(NULL, RDP_T_43 /* + */, &e3_stop);
      scan_();
      e3();
    }
    else
    if (scan_test(NULL, RDP_T_45 /* - */, NULL))
    {
      scan_test(NULL, RDP_T_45 /* - */, &e3_stop);
      scan_();
      e3();
    }
    else
      scan_test_set(NULL, &e3_first, &e3_stop)    ;
    scan_test_set(NULL, &e3_stop, &e3_stop);
   }
}
コード例 #3
0
static void e5(void)
{
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &e5_stop);
      scan_();
    }
    else
    if (scan_test(NULL, SCAN_P_INTEGER, NULL))
    {
      scan_test(NULL, SCAN_P_INTEGER, &e5_stop);
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      scan_test(NULL, RDP_T_40 /* ( */, &e5_stop);
      scan_();
      e1();
      scan_test(NULL, RDP_T_41 /* ) */, &e5_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &e5_first, &e5_stop)    ;
    scan_test_set(NULL, &e5_stop, &e5_stop);
   }
}
コード例 #4
0
static void e1(void)
{
  {
    e2();
    if (scan_test_set(NULL, &rdp_e1_2_first, NULL))
    { /* Start of rdp_e1_2 */
      while (1)
      {
        {
          if (scan_test(NULL, RDP_T_43 /* + */, NULL))
          {
            scan_test(NULL, RDP_T_43 /* + */, &e1_stop);
            scan_();
            e2();
          }
          else
          if (scan_test(NULL, RDP_T_45 /* - */, NULL))
          {
            scan_test(NULL, RDP_T_45 /* - */, &e1_stop);
            scan_();
            e2();
          }
          else
            scan_test_set(NULL, &rdp_e1_2_first, &e1_stop)          ;
          }
        if (!scan_test_set(NULL, &rdp_e1_2_first, NULL)) break;
      }
    } /* end of rdp_e1_2 */
    scan_test_set(NULL, &e1_stop, &e1_stop);
   }
}
コード例 #5
0
static void e2(void)
{
  {
    e3();
    if (scan_test_set(NULL, &rdp_e2_2_first, NULL))
    { /* Start of rdp_e2_2 */
      while (1)
      {
        {
          if (scan_test(NULL, RDP_T_42 /* * */, NULL))
          {
            scan_test(NULL, RDP_T_42 /* * */, &e2_stop);
            scan_();
            e3();
          }
          else
          if (scan_test(NULL, RDP_T_47 /* / */, NULL))
          {
            scan_test(NULL, RDP_T_47 /* / */, &e2_stop);
            scan_();
            e3();
          }
          else
            scan_test_set(NULL, &rdp_e2_2_first, &e2_stop)          ;
          }
        if (!scan_test_set(NULL, &rdp_e2_2_first, NULL)) break;
      }
    } /* end of rdp_e2_2 */
    scan_test_set(NULL, &e2_stop, &e2_stop);
   }
}
コード例 #6
0
static void reg(rdp_tree_node_data* rdp_tree)
{
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
      scan_test(NULL, SCAN_P_ID, &reg_stop);
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_35 /* # */, NULL))
    {
      if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
      scan_test(NULL, RDP_T_35 /* # */, &reg_stop);
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
      scan_test(NULL, RDP_T_40 /* ( */, &reg_stop);
      scan_();
      alt(rdp_add_child("alt", rdp_tree));
      if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
      scan_test(NULL, RDP_T_41 /* ) */, &reg_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &reg_first, &reg_stop)    ;
    scan_test_set(NULL, &reg_stop, &reg_stop);
   }
}
コード例 #7
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void e3(rdp_tree_node_data* rdp_tree)
{
  {
    if (scan_test_set(NULL, &rdp_e3_0_first, NULL))
    {
      if(rdp_tree_update) {rdp_tree->id = "e4"; rdp_tree->token = 0;}
e4(rdp_tree);
    }
    else
    if (scan_test(NULL, RDP_T_43 /* + */, NULL))
    {
      scan_test(NULL, RDP_T_43 /* + */, &e3_stop);
      scan_();
      e3(rdp_add_child("e3", rdp_tree));
    }
    else
    if (scan_test(NULL, RDP_T_45 /* - */, NULL))
    {
      if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
      scan_test(NULL, RDP_T_45 /* - */, &e3_stop);
      scan_();
      e3(rdp_add_child("e3", rdp_tree));
    }
    else
      scan_test_set(NULL, &e3_first, &e3_stop)    ;
    scan_test_set(NULL, &e3_stop, &e3_stop);
   }
}
コード例 #8
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void e5(rdp_tree_node_data* rdp_tree)
{
  char* name;
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
      scan_test(NULL, SCAN_P_ID, &e5_stop);
      name = SCAN_CAST->id;
      scan_();
      check_declared;
    }
    else
    if (scan_test(NULL, SCAN_P_INTEGER, NULL))
    {
      if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
      scan_test(NULL, SCAN_P_INTEGER, &e5_stop);
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      scan_test(NULL, RDP_T_40 /* ( */, &e5_stop);
      scan_();
      if(rdp_tree_update) {rdp_tree->id = "e1"; rdp_tree->token = 0;}
e1(rdp_tree);
      scan_test(NULL, RDP_T_41 /* ) */, &e5_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &e5_first, &e5_stop)    ;
    scan_test_set(NULL, &e5_stop, &e5_stop);
   }
}
コード例 #9
0
ファイル: minicond.c プロジェクト: dsholla/rdp1_6
static integer e5(void)
{
  integer result;
  char* name;
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &e5_stop);
      name = SCAN_CAST->id;
      scan_();
      _lookup(name, result);
    }
    else
    if (scan_test(NULL, SCAN_P_INTEGER, NULL))
    {
      scan_test(NULL, SCAN_P_INTEGER, &e5_stop);
      result = SCAN_CAST->data.i;
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      scan_test(NULL, RDP_T_40 /* ( */, &e5_stop);
      scan_();
      result = e1();
      scan_test(NULL, RDP_T_41 /* ) */, &e5_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &e5_first, &e5_stop)    ;
    scan_test_set(NULL, &e5_stop, &e5_stop);
   }
  return result;
}
コード例 #10
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
static integer e3(void)
{
  integer result;
  {
    if (scan_test(NULL, RDP_T_43 /* + */, NULL))
    {
      scan_test(NULL, RDP_T_43 /* + */, &e3_stop);
      scan_();
      result = e3();
    }
    else
    if (scan_test(NULL, RDP_T_45 /* - */, NULL))
    {
      scan_test(NULL, RDP_T_45 /* - */, &e3_stop);
      scan_();
      result = e3();
       result = -result; 
    }
    else
    if (scan_test_set(NULL, &rdp_e3_2_first, NULL))
    {
      result = e4();
    }
    else
      scan_test_set(NULL, &e3_first, &e3_stop)    ;
    scan_test_set(NULL, &e3_stop, &e3_stop);
   }
  return result;
}
コード例 #11
0
static void var_dec(void)
{
  {
    scan_test(NULL, RDP_T_int, &var_dec_stop);
    scan_();
    { /* Start of rdp_var_dec_3 */
      while (1)
      {
        scan_test(NULL, SCAN_P_ID, &var_dec_stop);
        {
          scan_test(NULL, SCAN_P_ID, &var_dec_stop);
          scan_();
          if (scan_test(NULL, RDP_T_61 /* = */, NULL))
          { /* Start of rdp_var_dec_1 */
            while (1)
            {
              {
                scan_test(NULL, RDP_T_61 /* = */, &var_dec_stop);
                scan_();
                e1();
                }
              break;   /* hi limit is 1! */
            }
          } /* end of rdp_var_dec_1 */
          }
        if (SCAN_CAST->token != RDP_T_44 /* , */) break;
        scan_();
      }
    } /* end of rdp_var_dec_3 */
    scan_test_set(NULL, &var_dec_stop, &var_dec_stop);
   }
}
コード例 #12
0
/* Parser functions */
void alt(rdp_tree_node_data* rdp_tree)
{
  {
    con(rdp_add_child("con", rdp_tree));
    if (scan_test(NULL, RDP_T_124 /* | */, NULL))
    { /* Start of rdp_alt_1 */
      while (1)
      {
        {
          if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
          scan_test(NULL, RDP_T_124 /* | */, &alt_stop);
          scan_();
          con(rdp_add_child("con", rdp_tree));
          }
        break;   /* hi limit is 1! */
      }
    } /* end of rdp_alt_1 */
    else
    {
      /* default action processing for rdp_alt_1*/
      if (rdp_tree_update) {rdp_tree_node_data *temp = rdp_add_child(NULL, rdp_tree); temp->id = NULL; temp->token = SCAN_P_ID;}
    }
    scan_test_set(NULL, &alt_stop, &alt_stop);
   }
}
コード例 #13
0
bool BorderCut::analyseTop ( cv::Mat& dest , cv::Mat* visual, int line_length,
		Points& points  ) {

	int x_end = dest.cols - line_length;
	int steps = ( x_end - line_length ) / num_of_grab_lines_ ;

	for (int x = line_length ; x < x_end ; x += steps ) {

		int y; // y coordinate of the point on the border line
		bool found = scan_(dest, cv::Point(x, 0 ) ,
				cv::Point(x,line_length ) , y ) ;

		if ( visual )
			cv::line(*visual , cv::Point(x, 0 ), cv::Point(x,line_length ) ,
					kArbitraryColor );

		if ( found ) {
			if ( visual )
				cv::line ( *visual , cv::Point ( x -5 , y) ,
						   cv::Point ( x + 5 , y ),  kEstimatedColor );

			points.push_back(cv::Point( x , y ));

		}
	}

	// check for minimal points
	if ( points.size() < num_of_grab_lines_ / 4 ) return false ;

	return true;
}
コード例 #14
0
bool BorderCut::analyseRight ( cv::Mat& dest , cv::Mat* visual, int line_length,
		Points& points ) {

	int y_end = dest.rows - line_length;
	int steps = ( y_end - line_length ) / num_of_grab_lines_ ;
	int x_start = dest.cols;
	int x_end   = dest.cols - line_length;

	for (int y = line_length ; y < y_end ; y += steps ) {

		int x; // x coordinate of the point on the border line
		bool found = scan_(dest, cv::Point(x_start , y ) ,
				cv::Point( x_end , y ) , x ) ;

		if ( visual )
			cv::line(*visual , cv::Point( x_start , y ), cv::Point( x_end ,y ) ,
				kArbitraryColor );

		if ( found ) {
			if ( visual)
				cv::line ( *visual , cv::Point ( dest.cols - x , y -5 ) ,
					   cv::Point ( dest.cols - x , y  + 5),  kEstimatedColor );
			points.push_back(cv::Point( dest.cols - x , y ));
		}
	}

	// check for minimal points
	if ( points.size() < num_of_grab_lines_ / 4 ) return false ;

	return true;
}
コード例 #15
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void e4(rdp_tree_node_data* rdp_tree)
{
  {
    e5(rdp_add_child("e5", rdp_tree));
    if (scan_test(NULL, RDP_T_4242 /* ** */, NULL))
    { /* Start of rdp_e4_1 */
      while (1)
      {
        {
          if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
          scan_test(NULL, RDP_T_4242 /* ** */, &e4_stop);
          scan_();
          e4(rdp_add_child("e4", rdp_tree));
          }
        break;   /* hi limit is 1! */
      }
    } /* end of rdp_e4_1 */
    else
    {
      /* default action processing for rdp_e4_1*/
      if (rdp_tree_update) {rdp_tree->id = NULL; rdp_tree->token = SCAN_P_ID;}
    }
    scan_test_set(NULL, &e4_stop, &e4_stop);
   }
}
コード例 #16
0
/* Parser functions */
static void String(void)
{
  {
    scan_test(NULL, RDP_T_34 /* " */, &String_stop);
    scan_();
    scan_test_set(NULL, &String_stop, &String_stop);
   }
}
コード例 #17
0
static void scan_skip(set_ * stop) /* scan until a token in stop set appears */
{
  while (!set_includes_element(stop, SCAN_CAST->token))
    scan_();                  /* Don't add tokens to tree when skipping! */
  
  if (scan_show_skips)
    text_message(TEXT_ERROR_ECHO, "Skipping to...\n"); 
}
コード例 #18
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
/* Parser functions */
static void String(rdp_tree_node_data* rdp_tree)
{
  {
    if (rdp_tree_update) rdp_add_child(NULL, rdp_tree);
    scan_test(NULL, RDP_T_34 /* " */, &String_stop);
    scan_();
    scan_test_set(NULL, &String_stop, &String_stop);
   }
}
コード例 #19
0
static void sym(void)
{
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &sym_stop);
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_35 /* # */, NULL))
    {
      scan_test(NULL, RDP_T_35 /* # */, &sym_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &sym_first, &sym_stop)    ;
    scan_test_set(NULL, &sym_stop, &sym_stop);
   }
}
コード例 #20
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void var_dec(rdp_tree_node_data* rdp_tree)
{
  {
    if (rdp_tree_update) memcpy(rdp_tree, text_scan_data, sizeof(scan_data));
    scan_test(NULL, RDP_T_int, &var_dec_stop);
    scan_();
    { /* Start of rdp_var_dec_1 */
      while (1)
      {
        scan_test(NULL, SCAN_P_ID, &var_dec_stop);
        {
          dec_body(rdp_add_child("dec_body", rdp_tree));
          }
        if (SCAN_CAST->token != RDP_T_44 /* , */) break;
        scan_();
      }
    } /* end of rdp_var_dec_1 */
    scan_test_set(NULL, &var_dec_stop, &var_dec_stop);
   }
}
コード例 #21
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
/* Parser functions */
static char* String(void)
{
  char* result;
  {
    scan_test(NULL, RDP_T_34 /* " */, &String_stop);
    result = SCAN_CAST->id;
    scan_();
    scan_test_set(NULL, &String_stop, &String_stop);
   }
  return result;
}
コード例 #22
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
static void statement(void)
{
  char* name;
  integer val;
  char* str;
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &statement_stop);
      name = SCAN_CAST->id;
      scan_();
       if (symbol_lookup_key(mini, &name, NULL) == NULL)\
                 {\
                   text_message(TEXT_ERROR, "Undeclared variable '%s'\n", name);\
                   symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data));\
                 }\
              
      scan_test(NULL, RDP_T_61 /* = */, &statement_stop);
      scan_();
      val = e1();
       mini_cast(symbol_lookup_key(mini, &name, NULL))->i = val; 
    }
    else
    if (scan_test(NULL, RDP_T_print, NULL))
    {
      scan_test(NULL, RDP_T_print, &statement_stop);
      scan_();
      scan_test(NULL, RDP_T_40 /* ( */, &statement_stop);
      scan_();
      { /* Start of rdp_statement_3 */
        while (1)
        {
          scan_test_set(NULL, &rdp_statement_3_first, &statement_stop);
          {
            if (scan_test_set(NULL, &rdp_statement_1_first, NULL))
            {
              val = e1();
               printf("%li", val); 
            }
            else
            if (scan_test(NULL, RDP_T_34 /* " */, NULL))
            {
              str = String();
               printf("%s", str); 
            }
            else
              scan_test_set(NULL, &rdp_statement_3_first, &statement_stop)            ;
            }
          if (SCAN_CAST->token != RDP_T_44 /* , */) break;
          scan_();
        }
      } /* end of rdp_statement_3 */
      scan_test(NULL, RDP_T_41 /* ) */, &statement_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &statement_first, &statement_stop)    ;
    scan_test_set(NULL, &statement_stop, &statement_stop);
   }
}
コード例 #23
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
static integer e5(void)
{
  integer result;
  char* name;
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &e5_stop);
      name = SCAN_CAST->id;
      scan_();
       if (symbol_lookup_key(mini, &name, NULL) == NULL)\
                 {\
                   text_message(TEXT_ERROR, "Undeclared variable '%s'\n", name);\
                   symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data));\
                 }\
              
 result = mini_cast(symbol_lookup_key(mini, &name, NULL))->i; 
    }
    else
    if (scan_test(NULL, SCAN_P_INTEGER, NULL))
    {
      scan_test(NULL, SCAN_P_INTEGER, &e5_stop);
      result = SCAN_CAST->data.i;
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      scan_test(NULL, RDP_T_40 /* ( */, &e5_stop);
      scan_();
      result = e1();
      scan_test(NULL, RDP_T_41 /* ) */, &e5_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &e5_first, &e5_stop)    ;
    scan_test_set(NULL, &e5_stop, &e5_stop);
   }
  return result;
}
コード例 #24
0
void
SCOCacheMountPoint::restart_()
{
    LOG_TRACE(path_);

    validateParams_();
    readMetaData_();
    scan_();

    initialised_ = true;

    LOG_DEBUG(path_ << ": restarted");
}
コード例 #25
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
static void e2(rdp_tree_node_data* rdp_tree)
{
  {
    if(rdp_tree_update) {rdp_tree->id = "e3"; rdp_tree->token = 0;}
e3(rdp_tree);
    if (scan_test_set(NULL, &rdp_e2_2_first, NULL))
    { /* Start of rdp_e2_2 */
      while (1)
      {
        {
          if (scan_test(NULL, RDP_T_42 /* * */, NULL))
          {
            if (rdp_tree_update) rdp_add_parent(NULL, rdp_tree);
            scan_test(NULL, RDP_T_42 /* * */, &e2_stop);
            scan_();
            e3(rdp_add_child("e3", rdp_tree));
          }
          else
          if (scan_test(NULL, RDP_T_47 /* / */, NULL))
          {
            if (rdp_tree_update) rdp_add_parent(NULL, rdp_tree);
            scan_test(NULL, RDP_T_47 /* / */, &e2_stop);
            scan_();
            e3(rdp_add_child("e3", rdp_tree));
          }
          else
            scan_test_set(NULL, &rdp_e2_2_first, &e2_stop)          ;
          }
        if (!scan_test_set(NULL, &rdp_e2_2_first, NULL)) break;
      }
    } /* end of rdp_e2_2 */
    else
    {
      /* default action processing for rdp_e2_2*/
      if (rdp_tree_update) {rdp_tree_node_data *temp = rdp_add_child(NULL, rdp_tree); temp->id = NULL; temp->token = SCAN_P_ID;}
    }
    scan_test_set(NULL, &e2_stop, &e2_stop);
   }
}
コード例 #26
0
ファイル: minicond.c プロジェクト: dsholla/rdp1_6
static integer e2(void)
{
  integer result;
  integer right;
  {
    result = e3();
    if (scan_test_set(NULL, &rdp_e2_2_first, NULL))
    { /* Start of rdp_e2_2 */
      while (1)
      {
        {
          if (scan_test(NULL, RDP_T_42 /* * */, NULL))
          {
            scan_test(NULL, RDP_T_42 /* * */, &e2_stop);
            scan_();
            right = e3();
             result *= right; 
          }
          else
          if (scan_test(NULL, RDP_T_47 /* / */, NULL))
          {
            scan_test(NULL, RDP_T_47 /* / */, &e2_stop);
            scan_();
            right = e3();
             if (result == 0)       \
                               text_message(TEXT_FATAL_ECHO, "Divide by zero attempted\n"); \
                             else result /= right; \
                          
          }
          else
            scan_test_set(NULL, &rdp_e2_2_first, &e2_stop)          ;
          }
        if (!scan_test_set(NULL, &rdp_e2_2_first, NULL)) break;
      }
    } /* end of rdp_e2_2 */
    scan_test_set(NULL, &e2_stop, &e2_stop);
   }
  return result;
}
コード例 #27
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
static void var_dec(void)
{
  char* name;
  integer val;
  {
    scan_test(NULL, RDP_T_int, &var_dec_stop);
    scan_();
    { /* Start of rdp_var_dec_3 */
      while (1)
      {
        scan_test(NULL, SCAN_P_ID, &var_dec_stop);
        {
          scan_test(NULL, SCAN_P_ID, &var_dec_stop);
          name = SCAN_CAST->id;
          scan_();
          if (scan_test(NULL, RDP_T_61 /* = */, NULL))
          { /* Start of rdp_var_dec_1 */
            while (1)
            {
              {
                scan_test(NULL, RDP_T_61 /* = */, &var_dec_stop);
                scan_();
                val = e1();
                }
              break;   /* hi limit is 1! */
            }
          } /* end of rdp_var_dec_1 */
           mini_cast(symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data)))\
                   ->i = val; \
                
          }
        if (SCAN_CAST->token != RDP_T_44 /* , */) break;
        scan_();
      }
    } /* end of rdp_var_dec_3 */
    scan_test_set(NULL, &var_dec_stop, &var_dec_stop);
   }
}
コード例 #28
0
ファイル: minicond.c プロジェクト: dsholla/rdp1_6
static void var_dec(integer interpret)
{
  char* name;
  integer val;
  {
    scan_test(NULL, RDP_T_int, &var_dec_stop);
    scan_();
    { /* Start of rdp_var_dec_3 */
      while (1)
      {
        scan_test(NULL, SCAN_P_ID, &var_dec_stop);
        {
          scan_test(NULL, SCAN_P_ID, &var_dec_stop);
          name = SCAN_CAST->id;
          scan_();
          _insert(name);
          if (scan_test(NULL, RDP_T_61 /* = */, NULL))
          { /* Start of rdp_var_dec_1 */
            while (1)
            {
              {
                scan_test(NULL, RDP_T_61 /* = */, &var_dec_stop);
                scan_();
                val = e0();
                _update(name, val);
                }
              break;   /* hi limit is 1! */
            }
          } /* end of rdp_var_dec_1 */
          }
        if (SCAN_CAST->token != RDP_T_44 /* , */) break;
        scan_();
      }
    } /* end of rdp_var_dec_3 */
    scan_test_set(NULL, &var_dec_stop, &var_dec_stop);
   }
}
コード例 #29
0
ファイル: minicalc.c プロジェクト: dsholla/rdp1_6
static integer e1(void)
{
  integer result;
  integer right;
  {
    result = e2();
    if (scan_test_set(NULL, &rdp_e1_2_first, NULL))
    { /* Start of rdp_e1_2 */
      while (1)
      {
        {
          if (scan_test(NULL, RDP_T_43 /* + */, NULL))
          {
            scan_test(NULL, RDP_T_43 /* + */, &e1_stop);
            scan_();
            right = e2();
             result += right; 
          }
          else
          if (scan_test(NULL, RDP_T_45 /* - */, NULL))
          {
            scan_test(NULL, RDP_T_45 /* - */, &e1_stop);
            scan_();
            right = e2();
             result -= right; 
          }
          else
            scan_test_set(NULL, &rdp_e1_2_first, &e1_stop)          ;
          }
        if (!scan_test_set(NULL, &rdp_e1_2_first, NULL)) break;
      }
    } /* end of rdp_e1_2 */
    scan_test_set(NULL, &e1_stop, &e1_stop);
   }
  return result;
}
コード例 #30
0
ファイル: minitree.c プロジェクト: dsholla/rdp1_6
void program(rdp_tree_node_data* rdp_tree)
{
  {
    if (scan_test_set(NULL, &rdp_program_4_first, NULL))
    { /* Start of rdp_program_4 */
      while (1)
      {
        {
          if (scan_test_set(NULL, &rdp_program_2_first, NULL))
          { /* Start of rdp_program_2 */
            while (1)
            {
              {
                if (scan_test(NULL, RDP_T_int, NULL))
                {
                  var_dec(rdp_add_child("var_dec", rdp_tree));
                }
                else
                if (scan_test_set(NULL, &rdp_program_1_first, NULL))
                {
                  statement(rdp_add_child("statement", rdp_tree));
                }
                else
                  scan_test_set(NULL, &rdp_program_2_first, &program_stop)                ;
                }
              break;   /* hi limit is 1! */
            }
          } /* end of rdp_program_2 */
          else
          {
            /* default action processing for rdp_program_2*/
            if (rdp_tree_update) {rdp_tree_node_data *temp = rdp_add_child(NULL, rdp_tree); temp->id = NULL; temp->token = SCAN_P_ID;}
          }
          scan_test(NULL, RDP_T_59 /* ; */, &program_stop);
          scan_();
          }
        if (!scan_test_set(NULL, &rdp_program_4_first, NULL)) break;
      }
    } /* end of rdp_program_4 */
    else
    {
      /* default action processing for rdp_program_4*/
      if (rdp_tree_update) {rdp_tree_node_data *temp = rdp_add_child(NULL, rdp_tree); temp->id = NULL; temp->token = SCAN_P_ID;}
    }
    scan_test_set(NULL, &program_stop, &program_stop);
   }
}