コード例 #1
0
ファイル: main.c プロジェクト: danielkeller/cinterp
int main(int argc, char*argv[])
{
	if(argc > 1)
		if (strncmp(argv[1], "-d", 2)==0)
			yydebug = 1;

	int status;
	
	YYSTYPE yylval;
	YYLTYPE yyloc = {0};
	int tok;
	
	yypstate *ps = yypstate_new ();
	do {
		tok = yylex (&yylval, &yyloc);
		status = yypush_parse (ps, tok, &yylval, &yyloc, tok);
	} while (status == YYPUSH_MORE);
	yypstate_delete (ps);

	return 0;
}
コード例 #2
0
ファイル: IpeReader.cpp プロジェクト: jcazzie/chapel
IpeReader::~IpeReader()
{
  currentFileNamedOnCommandLine = false;

  chplParseStringMsg            =  NULL;
  chplParseString               = false;

  chplLineno                    =    -1;

  mYYlloc.last_column           =     0;
  mYYlloc.last_line             =    -1;

  mYYlloc.first_column          =     0;
  mYYlloc.first_line            =    -1;

  yystartlineno                 =    -1;
  yyfilename                    =  NULL;

  yypstate_delete(mParser);

  yylex_destroy(mContext.scanner);
}