Parser-Ausgabe in Datei res\listParser.txt
This commit is contained in:
parent
c821168dbe
commit
67b9d12430
3 changed files with 25 additions and 5 deletions
|
@ -80,10 +80,11 @@ int CParser::yyparse(PrimImplikantCollection* &pic, vector<string>* &variables)
|
||||||
switch(tok)
|
switch(tok)
|
||||||
{
|
{
|
||||||
case IDENTIFIER:
|
case IDENTIFIER:
|
||||||
printf("Variable %s\n", yylval.s.c_str());
|
fprintf(IP_List, "Variable %s\n", yylval.s.c_str());
|
||||||
variables->push_back(yylval.s.c_str());
|
variables->push_back(yylval.s.c_str());
|
||||||
break;
|
break;
|
||||||
case TERMS:
|
case TERMS:
|
||||||
|
fprintf(IP_List, "\n", yylval.s.c_str());
|
||||||
pState = P_TERMS_KEY;
|
pState = P_TERMS_KEY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -92,11 +93,11 @@ int CParser::yyparse(PrimImplikantCollection* &pic, vector<string>* &variables)
|
||||||
switch(tok)
|
switch(tok)
|
||||||
{
|
{
|
||||||
case STRING1:
|
case STRING1:
|
||||||
printf("Term Key %s\n", yylval.s.c_str());
|
fprintf(IP_List, "Term Key %s\n", yylval.s.c_str());
|
||||||
pic->add(yylval.s.c_str());
|
pic->add(yylval.s.c_str());
|
||||||
break;
|
break;
|
||||||
case INTEGER1:
|
case INTEGER1:
|
||||||
printf("Term Key %d\n", (unsigned int)yylval.i);
|
fprintf(IP_List, "Term Key %d\n", (unsigned int)yylval.i);
|
||||||
pic->add(yylval.i);
|
pic->add(yylval.i);
|
||||||
break;
|
break;
|
||||||
case (int)'>':
|
case (int)'>':
|
||||||
|
@ -124,7 +125,7 @@ int CParser::yyparse(PrimImplikantCollection* &pic, vector<string>* &variables)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Term Value %d\n\n",yylval.i);
|
fprintf(IP_List, "Term Value %d\n\n",yylval.i);
|
||||||
pState = P_TERMS_KEY;
|
pState = P_TERMS_KEY;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -49,7 +49,6 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||||
|
|
||||||
CParser parser;
|
CParser parser;
|
||||||
parser.IP_init_token_table();
|
parser.IP_init_token_table();
|
||||||
parser.pr_tokentable();
|
|
||||||
parser.InitParse(input, error, list);
|
parser.InitParse(input, error, list);
|
||||||
if (parser.yyparse(globalPIC, variables) != 0)
|
if (parser.yyparse(globalPIC, variables) != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
Variable a
|
||||||
|
Variable bar
|
||||||
|
Variable char
|
||||||
|
Variable d
|
||||||
|
|
||||||
|
Term Key 0010
|
||||||
|
Term Value 1
|
||||||
|
|
||||||
|
Term Key 7
|
||||||
|
Term Value 1
|
||||||
|
|
||||||
|
Term Key 14
|
||||||
|
Term Value 1
|
||||||
|
|
||||||
|
Term Key 01xx
|
||||||
|
Term Value 1
|
||||||
|
|
||||||
|
Term Key x000
|
||||||
|
Term Value 1
|
||||||
|
|
Loading…
Reference in a new issue