/*
 * nwcc : syntax analysis program copyright (C) 2009 - 2013 H.Niwa
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
using namespace std;

#include "nwcc.h"
#include "nwcclex.h"
const char *InputSuffix = "n";
const char *OutputSuffix = "c";
int
NwccMain () 
{
  int Nwcc ();
  ErrorFlg = Nwcc ();
  if (ErrorFlg)
    ErrorStop (MESG);
  return 0;
}
int
Nwcc () 
{
  fprintf (pr, "#include <stdio.h>\n");
  fprintf (pr, "#include <ctype.h>\n");
  fprintf (pr, "#include <string.h>\n");
  fprintf (pr, "#include <stdlib.h>\n");
  fprintf (pr, "#include <iostream>\n");
  fprintf (pr, "#include <fstream>\n");
  fprintf (pr, "#include <string>\n");
  fprintf (pr, "#include <vector>\n");
  fprintf (pr, "#include <map>\n");
  fprintf (pr, "using namespace std;\n");
  fprintf (pr, "#include \"nwcc.h\"\n");
  fprintf (pr, "#include \"nwcclex.h\"\n");
  ErrorFlg = 0;
  MESG = NULL;
  
  do
    {
      long chktell1, chktell2;
      chktell1 = FilePointSave ();
      int Action ();
      ErrorFlg = Action ();
      MESG = "Action is missing ";
      if (ErrorFlg)
	{
	}
      if (!ErrorFlg)
	{
	}
      chktell2 = FilePointSave ();
      if ((chktell1 == chktell2) && !ErrorFlg)
	ErrorStop ("endless loop occured");
    }
  while (!ErrorFlg);
  ErrorFlg = 0;
  MESG = NULL;
  if (!ErrorFlg)
    {
      ErrorFlg = COMP ("Suffix");
      MESG = "\"Suffix\" is missing ";
      if (ErrorFlg)
	{
	}
      if (!ErrorFlg)
	{
	  int WRD ();
	  ErrorFlg = WRD ();
	  MESG = "WRD is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  fprintf (pr, "const char* InputSuffix=\"%s\";\n", TOKEN);
	  ErrorFlg = COMP (",");
	  MESG = "\",\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  int WRD ();
	  ErrorFlg = WRD ();
	  MESG = "WRD is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  fprintf (pr, "const char* OutputSuffix=\"%s\";\n", TOKEN);
	  ErrorFlg = COMP (";");
	  MESG = "\";\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  ErrorFlg = COMP ("Syntax");
	  MESG = "\"Syntax\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  fprintf (pr, "int NwccMain()\n{\n");
	  
	  do
	    {
	      long chktell1, chktell2;
	      chktell1 = FilePointSave ();
	      int Action ();
	      ErrorFlg = Action ();
	      MESG = "Action is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	      chktell2 = FilePointSave ();
	      if ((chktell1 == chktell2) && !ErrorFlg)
		ErrorStop ("endless loop occured");
	    }
	  while (!ErrorFlg);
	  ErrorFlg = 0;
	  MESG = NULL;
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  int ID ();
	  ErrorFlg = ID ();
	  MESG = "ID is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  
	  do
	    {
	      long chktell1, chktell2;
	      chktell1 = FilePointSave ();
	      int Action ();
	      ErrorFlg = Action ();
	      MESG = "Action is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	      chktell2 = FilePointSave ();
	      if ((chktell1 == chktell2) && !ErrorFlg)
		ErrorStop ("endless loop occured");
	    }
	  while (!ErrorFlg);
	  ErrorFlg = 0;
	  MESG = NULL;
	  if (ErrorFlg)
	    ErrorStop (MESG);
	  fprintf (pr, "int %s();\n", TOKEN);
	  fprintf (pr, "ErrorFlg=%s();\n", TOKEN);
	  fprintf (pr, "if(ErrorFlg) ErrorStop(MESG);\n");
	  fprintf (pr, "return 0;\n");
	  fprintf (pr, "}\n\n");
	  ErrorFlg = COMP (";");
	  MESG = "\";\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    ErrorStop (MESG);
	}
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  int NotEof ();
	  ErrorFlg = NotEof ();
	  MESG = "NotEof is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (!ErrorFlg)
	    {
	      int Expression ();
	      ErrorFlg = Expression ();
	      MESG = "Expression is missing ";
	      if (ErrorFlg)
		{
		}
	      if (ErrorFlg)
		ErrorStop (MESG);
	    }
	  chktell2 = FilePointSave ();
	  if ((chktell1 == chktell2) && !ErrorFlg)
	    ErrorStop ("endless loop occured");
	}
      while (!ErrorFlg);
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
      int Eof ();
      ErrorFlg = Eof ();
      MESG = "Eof is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
    }
  return ErrorFlg;
}
int
Expression () 
{
  ErrorFlg = 0;
  MESG = NULL;
  int ID ();
  ErrorFlg = ID ();
  MESG = "ID is missing ";
  if (ErrorFlg)
    {
    }
  if (!ErrorFlg)
    {
      
      {
	fprintf (pr, "int %s()\n", TOKEN);
	fprintf (pr, "{\n");
	ErrorFlg = COMP ("=");
	MESG = "\"=\" is missing ";
	if (ErrorFlg)
	  {
	  }
	if (ErrorFlg)
	  ErrorStop (MESG);
	
	do
	  {
	    long chktell1, chktell2;
	    chktell1 = FilePointSave ();
	    int Action ();
	    ErrorFlg = Action ();
	    MESG = "Action is missing ";
	    if (ErrorFlg)
	      {
	      }
	    if (!ErrorFlg)
	      {
	      }
	    chktell2 = FilePointSave ();
	    if ((chktell1 == chktell2) && !ErrorFlg)
	      ErrorStop ("endless loop occured");
	  }
	while (!ErrorFlg);
	ErrorFlg = 0;
	MESG = NULL;
	if (ErrorFlg)
	  ErrorStop (MESG);
	fprintf (pr, "ErrorFlg = 0;\nMESG=NULL;\n");
	int Term ();
	ErrorFlg = Term ();
	MESG = "Term is missing ";
	if (ErrorFlg)
	  {
	  }
	if (!ErrorFlg)
	  {
	  }
	ErrorFlg = 0;
	MESG = NULL;
	if (ErrorFlg)
	  ErrorStop (MESG);
	ErrorFlg = COMP (";");
	MESG = "\";\" is missing ";
	if (ErrorFlg)
	  {
	  }
	if (ErrorFlg)
	  ErrorStop (MESG);
	fprintf (pr, "return ErrorFlg;\n");
	fprintf (pr, "}\n\n");
      }
    }
  return ErrorFlg;
}
int
ErrMESG () 
{
  ErrorFlg = 0;
  MESG = NULL;
  ErrorFlg = COMP ("!");
  MESG = "\"!\" is missing ";
  if (ErrorFlg)
    {
    }
  if (!ErrorFlg)
    {
      int STRINGS ();
      ErrorFlg = STRINGS ();
      MESG = "STRINGS is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
      fprintf (pr, "MESG=\"%s\";\n", TOKEN);
    }
  return ErrorFlg;
}
int
ErrAction () 
{
  
  {
    ErrorFlg = 0;
    MESG = NULL;
    ErrorFlg = COMP ("</!");
    MESG = "\"</!\" is missing ";
    if (ErrorFlg)
      {
      }
    if (!ErrorFlg)
      {
	fprintf (pr, "{\n");
	UNTIL ("/>");
	if (ErrorFlg)
	  ErrorStop (MESG);
	fprintf (pr, "\n}\n");
      }
  }
  return ErrorFlg;
}
int
Action () 
{
  
  {
    ErrorFlg = 0;
    MESG = NULL;
    ErrorFlg = COMP ("</");
    MESG = "\"</\" is missing ";
    if (ErrorFlg)
      {
      }
    if (!ErrorFlg)
      {
	UNTIL ("/>");
	if (ErrorFlg)
	  ErrorStop (MESG);
	fprintf (pr, "\n");
      }
  }
  return ErrorFlg;
}
int
Term () 
{
  ErrorFlg = 0;
  MESG = NULL;
  int FactorS ();
  ErrorFlg = FactorS ();
  MESG = "FactorS is missing ";
  if (ErrorFlg)
    {
    }
  if (!ErrorFlg)
    {
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  ErrorFlg = COMP ("|");
	  MESG = "\"|\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (!ErrorFlg)
	    {
	      fprintf (pr, "if(ErrorFlg){\n");
	      int FactorS ();
	      ErrorFlg = FactorS ();
	      MESG = "FactorS is missing ";
	      if (ErrorFlg)
		{
		}
	      if (ErrorFlg)
		ErrorStop (MESG);
	      fprintf (pr, "}\n");
	    }
	  chktell2 = FilePointSave ();
	  if ((chktell1 == chktell2) && !ErrorFlg)
	    ErrorStop ("endless loop occured");
	}
      while (!ErrorFlg);
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
    }
  return ErrorFlg;
}
int
FactorS () 
{
  ErrorFlg = 0;
  MESG = NULL;
  
  {
    int nloop = 0;
    
    do
      {
	long chktell1, chktell2;
	chktell1 = FilePointSave ();
	int Factor ();
	ErrorFlg = Factor ();
	MESG = "Factor is missing ";
	if (ErrorFlg)
	  {
	  }
	if (!ErrorFlg)
	  {
	  }
	if (ErrorFlg)
	  {
	    int Action ();
	    ErrorFlg = Action ();
	    MESG = "Action is missing ";
	    if (ErrorFlg)
	      {
	      }
	    if (!ErrorFlg)
	      {
		fprintf (pr, "ErrorFlg = 0;MESG=NULL;\n\n");
	      }
	  }
	if (!ErrorFlg)
	  nloop++;
      }
    while (0);
  }
  if (!ErrorFlg)
    {
      fprintf (pr, "if(!ErrorFlg){\n");
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  int Factor ();
	  ErrorFlg = Factor ();
	  MESG = "Factor is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (!ErrorFlg)
	    {
	      fprintf (pr, "if(ErrorFlg) ErrorStop(MESG);\n");
	    }
	  if (ErrorFlg)
	    {
	      int Action ();
	      ErrorFlg = Action ();
	      MESG = "Action is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	    }
	  chktell2 = FilePointSave ();
	  if ((chktell1 == chktell2) && !ErrorFlg)
	    ErrorStop ("endless loop occured");
	}
      while (!ErrorFlg);
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
      fprintf (pr, "}\n");
    }
  return ErrorFlg;
}
int
Factor () 
{
  
  {
    long tellsave;
    tellsave = FilePointSave ();
    ErrorFlg = 0;
    MESG = NULL;
    
    {
      int nloop = 0;
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  ErrorFlg = COMP ("UNTIL");
	  MESG = "\"UNTIL\" is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (!ErrorFlg)
	    {
	      ErrorFlg = COMP ("(");
	      MESG = "\"(\" is missing ";
	      if (ErrorFlg)
		{
		}
	      if (ErrorFlg)
		ErrorStop (MESG);
	      int STRINGS ();
	      ErrorFlg = STRINGS ();
	      MESG = "STRINGS is missing ";
	      if (ErrorFlg)
		{
		}
	      if (ErrorFlg)
		ErrorStop (MESG);
	      fprintf (pr, "UNTIL(\"%s\");\n", TOKEN);
	      ErrorFlg = COMP (")");
	      MESG = "\")\" is missing ";
	      if (ErrorFlg)
		{
		}
	      if (ErrorFlg)
		ErrorStop (MESG);
	    }
	  if (ErrorFlg)
	    {
	      ErrorFlg = COMP ("SKIP");
	      MESG = "\"SKIP\" is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		  ErrorFlg = COMP ("(");
		  MESG = "\"(\" is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  int STRINGS ();
		  ErrorFlg = STRINGS ();
		  MESG = "STRINGS is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  fprintf (pr, "SKIP(\"%s\");\n", TOKEN);
		  ErrorFlg = COMP (")");
		  MESG = "\")\" is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		}
	    }
	  if (ErrorFlg)
	    {
	      ErrorFlg = COMP ("CHECK");
	      MESG = "\"CHECK\" is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		  ErrorFlg = COMP ("(");
		  MESG = "\"(\" is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  int STRINGS ();
		  ErrorFlg = STRINGS ();
		  MESG = "STRINGS is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  fprintf (pr, "ErrorFlg = CHECK(\"%s\");\n", TOKEN);
		  ErrorFlg = COMP (")");
		  MESG = "\")\" is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		}
	    }
	  if (ErrorFlg)
	    {
	      int ID ();
	      ErrorFlg = ID ();
	      MESG = "ID is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		  if (strcmp (TOKEN, "NOT") == 0)
		    {
		      ErrorFlg = 1;
		      FilePointResume (tellsave);
		      return ErrorFlg;
		    }
		  fprintf (pr, "int %s();\n", TOKEN);
		  fprintf (pr, "ErrorFlg = %s();\n", TOKEN);
		  fprintf (pr, "MESG=\"%s is missing \";\n", TOKEN);
		  fprintf (pr, "if (ErrorFlg) {\n");
		  
		  do
		    {
		      long chktell1, chktell2;
		      chktell1 = FilePointSave ();
		      int ErrMESG ();
		      ErrorFlg = ErrMESG ();
		      MESG = "ErrMESG is missing ";
		      if (ErrorFlg)
			{
			}
		      if (!ErrorFlg)
			{
			}
		      if (ErrorFlg)
			{
			  int ErrAction ();
			  ErrorFlg = ErrAction ();
			  MESG = "ErrAction is missing ";
			  if (ErrorFlg)
			    {
			    }
			  if (!ErrorFlg)
			    {
			    }
			}
		      chktell2 = FilePointSave ();
		      if ((chktell1 == chktell2) && !ErrorFlg)
			ErrorStop ("endless loop occured");
		    }
		  while (!ErrorFlg);
		  ErrorFlg = 0;
		  MESG = NULL;
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  fprintf (pr, "}\n");
		}
	    }
	  if (ErrorFlg)
	    {
	      int STRINGS ();
	      ErrorFlg = STRINGS ();
	      MESG = "STRINGS is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		  fprintf (pr, "ErrorFlg = COMP(\"%s\");\n", TOKEN);
		  fprintf (pr, "MESG=\"\\\"%s\\\" is missing \";\n", TOKEN);
		  fprintf (pr, "if (ErrorFlg) {\n");
		  
		  do
		    {
		      long chktell1, chktell2;
		      chktell1 = FilePointSave ();
		      int ErrMESG ();
		      ErrorFlg = ErrMESG ();
		      MESG = "ErrMESG is missing ";
		      if (ErrorFlg)
			{
			}
		      if (!ErrorFlg)
			{
			}
		      if (ErrorFlg)
			{
			  int ErrAction ();
			  ErrorFlg = ErrAction ();
			  MESG = "ErrAction is missing ";
			  if (ErrorFlg)
			    {
			    }
			  if (!ErrorFlg)
			    {
			    }
			}
		      chktell2 = FilePointSave ();
		      if ((chktell1 == chktell2) && !ErrorFlg)
			ErrorStop ("endless loop occured");
		    }
		  while (!ErrorFlg);
		  ErrorFlg = 0;
		  MESG = NULL;
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  fprintf (pr, "}\n");
		}
	    }
	  if (ErrorFlg)
	    {
	      int block ();
	      ErrorFlg = block ();
	      MESG = "block is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	    }
	  if (ErrorFlg)
	    {
	      ErrorFlg = COMP ("[");
	      MESG = "\"[\" is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		  int Term ();
		  ErrorFlg = Term ();
		  MESG = "Term is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  ErrorFlg = COMP ("]");
		  MESG = "\"]\" is missing ";
		  if (ErrorFlg)
		    {
		    }
		  if (ErrorFlg)
		    ErrorStop (MESG);
		  fprintf (pr, "ErrorFlg = 0;\nMESG=NULL;\n");
		}
	    }
	  if (ErrorFlg)
	    {
	      int loop ();
	      ErrorFlg = loop ();
	      MESG = "loop is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	    }
	  if (!ErrorFlg)
	    nloop++;
	}
      while (0);
    }
    if (!ErrorFlg)
      {
      }
  }
  return ErrorFlg;
}
int
block () 
{
  ErrorFlg = 0;
  MESG = NULL;
  ErrorFlg = COMP ("(");
  MESG = "\"(\" is missing ";
  if (ErrorFlg)
    {
    }
  if (!ErrorFlg)
    {
      fprintf (pr, "{\nint nloop = 0;\n");
      fprintf (pr, "do {\n");
      fprintf (pr, "long chktell1,chktell2;\n");
      fprintf (pr, "chktell1=FilePointSave();\n");
      int Term ();
      ErrorFlg = Term ();
      MESG = "Term is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
      fprintf (pr, "if (!ErrorFlg) nloop++;\n");
      ErrorFlg = COMP (")");
      MESG = "\")\" is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
      fprintf (pr, "}while(0);\n}\n");
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  int ErrMESG ();
	  ErrorFlg = ErrMESG ();
	  MESG = "ErrMESG is missing ";
	  if (ErrorFlg)
	    {
	    }
	  if (!ErrorFlg)
	    {
	    }
	  if (ErrorFlg)
	    {
	      int ErrAction ();
	      ErrorFlg = ErrAction ();
	      MESG = "ErrAction is missing ";
	      if (ErrorFlg)
		{
		}
	      if (!ErrorFlg)
		{
		}
	    }
	  chktell2 = FilePointSave ();
	  if ((chktell1 == chktell2) && !ErrorFlg)
	    ErrorStop ("endless loop occured");
	}
      while (!ErrorFlg);
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
    }
  return ErrorFlg;
}
int
loop () 
{
  ErrorFlg = 0;
  MESG = NULL;
  ErrorFlg = COMP ("{");
  MESG = "\"{\" is missing ";
  if (ErrorFlg)
    {
    }
  if (!ErrorFlg)
    {
      fprintf (pr, "do {\n");
      fprintf (pr, "long chktell1,chktell2;\n");
      fprintf (pr, "chktell1=FilePointSave();\n");
      
      do
	{
	  long chktell1, chktell2;
	  chktell1 = FilePointSave ();
	  
	  {
	    int nloop = 0;
	    
	    do
	      {
		long chktell1, chktell2;
		chktell1 = FilePointSave ();
		ErrorFlg = COMP ("NOT");
		MESG = "\"NOT\" is missing ";
		if (ErrorFlg)
		  {
		  }
		if (!ErrorFlg)
		  {
		    ErrorFlg = COMP ("(");
		    MESG = "\"(\" is missing ";
		    if (ErrorFlg)
		      {
		      }
		    if (ErrorFlg)
		      ErrorStop (MESG);
		    
		    {
		      int nloop = 0;
		      
		      do
			{
			  long chktell1, chktell2;
			  chktell1 = FilePointSave ();
			  int STRINGS ();
			  ErrorFlg = STRINGS ();
			  MESG = "STRINGS is missing ";
			  if (ErrorFlg)
			    {
			    }
			  if (!ErrorFlg)
			    {
			      fprintf (pr, "if (NOT(\"%s\")) break;\n",
					 TOKEN);
			    }
			  if (!ErrorFlg)
			    nloop++;
			}
		      while (0);
		    }
		    if (ErrorFlg)
		      ErrorStop (MESG);
		    ErrorFlg = COMP (")");
		    MESG = "\")\" is missing ";
		    if (ErrorFlg)
		      {
		      }
		    if (ErrorFlg)
		      ErrorStop (MESG);
		  }
		if (!ErrorFlg)
		  nloop++;
	      }
	    while (0);
	  }
	  if (!ErrorFlg)
	    {
	    }
	  chktell2 = FilePointSave ();
	  if ((chktell1 == chktell2) && !ErrorFlg)
	    ErrorStop ("endless loop occured");
	}
      while (!ErrorFlg);
      ErrorFlg = 0;
      MESG = NULL;
      if (ErrorFlg)
	ErrorStop (MESG);
      int Term ();
      ErrorFlg = Term ();
      MESG = "Term is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
      ErrorFlg = COMP ("}");
      MESG = "\"}\" is missing ";
      if (ErrorFlg)
	{
	}
      if (ErrorFlg)
	ErrorStop (MESG);
      fprintf (pr, "chktell2=FilePointSave();\n");
      fprintf (pr, "if ((chktell1 == chktell2) && !ErrorFlg)\n");
      fprintf (pr, "  ErrorStop(\"endless loop occured\");\n");
      fprintf (pr, "}while(!ErrorFlg);\n");
      fprintf (pr, "ErrorFlg = 0;\nMESG=NULL;\n");
    }
  return ErrorFlg;
}


