Print expected tokens in yyerror function.

2008-03-08 Thread Necrosoft
Hi I would know the expected token in a parser (GLR also..l) when yyerror function is invoked. For example: A = aB | bB B = b | c etc if the string in input is "ad$", in yyerror I would capture correct tokens expected...like b or c. Ho I can make that? Many Thanks Bye

Recognize grammar prefix.

2008-01-13 Thread Necrosoft
HI I would like to recognize a "prefix of a grammar" from an input sequence. You can assume that lex reads a string to be recognized from a file. In "interactive mode" the "prefix" is not a problem because a valid sequence is recognized "step by step" when we insert an Input. for example I have:

Using yyparse with command line parameters.

2008-01-11 Thread Necrosoft
Hi How I can run bison from C source code passing a string to parse? For example I have abcbdc sequence to parse. I can call yyparse function passing this string like parameters or directly like executable parameters (./parser abcbdc) ? Many thanks for any suggestion. Bye __