* Added parse_jumptoeof() to set the jumptoeof flag and parse_shall_skip() to
get it. * Adjusted parse_file() to terminate when jumptoeof was invoked and reset the jumptoeof flag. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@256 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+16
-1
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
static PARSE *yypsave;
|
static PARSE *yypsave;
|
||||||
|
|
||||||
|
static int jumptoeof = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
parse_file( char *f )
|
parse_file( char *f )
|
||||||
{
|
{
|
||||||
@@ -33,7 +35,7 @@ parse_file( char *f )
|
|||||||
/* Execute it outside of the parser so that recursive */
|
/* Execute it outside of the parser so that recursive */
|
||||||
/* calls to yyrun() work (no recursive yyparse's). */
|
/* calls to yyrun() work (no recursive yyparse's). */
|
||||||
|
|
||||||
for(;;)
|
while (!parse_shall_skip())
|
||||||
{
|
{
|
||||||
LOL l;
|
LOL l;
|
||||||
PARSE *p;
|
PARSE *p;
|
||||||
@@ -57,6 +59,7 @@ parse_file( char *f )
|
|||||||
|
|
||||||
parse_free( p );
|
parse_free( p );
|
||||||
}
|
}
|
||||||
|
jumptoeof = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -65,6 +68,18 @@ parse_save( PARSE *p )
|
|||||||
yypsave = p;
|
yypsave = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
parse_jumptoeof()
|
||||||
|
{
|
||||||
|
jumptoeof = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
parse_shall_skip()
|
||||||
|
{
|
||||||
|
return jumptoeof;
|
||||||
|
}
|
||||||
|
|
||||||
PARSE *
|
PARSE *
|
||||||
parse_make(
|
parse_make(
|
||||||
LIST *(*func)( PARSE *p, LOL *args ),
|
LIST *(*func)( PARSE *p, LOL *args ),
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ struct _PARSE {
|
|||||||
|
|
||||||
void parse_file( char *f );
|
void parse_file( char *f );
|
||||||
void parse_save( PARSE *p );
|
void parse_save( PARSE *p );
|
||||||
|
void parse_jumptoeof();
|
||||||
|
int parse_shall_skip();
|
||||||
|
|
||||||
PARSE * parse_make(
|
PARSE * parse_make(
|
||||||
LIST *(*func)( PARSE *p, LOL *args ),
|
LIST *(*func)( PARSE *p, LOL *args ),
|
||||||
|
|||||||
Reference in New Issue
Block a user