struct op_s * parse (char *filename) { int fd; return (fd = lex_open (filename)) < 0 ? NULL : parsei (fd); }
/* Create a singleton input source on an empty lexer stack. This will * fail if there is already an input source, or if the underlying disk * file cannot be opened. * * Returns TRUE if a new input object was successfully created. */ int/*BOOL*/ lex_init_stack( const char * path, const char * mode ) { if (NULL != lex_stack || NULL == path) return FALSE; lex_stack = lex_open(path, mode); return (NULL != lex_stack); }
/* Push another file on the parsing stack. If the mode is NULL, create a * FILE_INFO suitable for in-memory parsing; otherwise, create a * FILE_INFO that is bound to a local/disc file. Note that 'path' must * not be NULL, or the function will fail. * * Returns TRUE if a new info record was pushed onto the stack. */ int/*BOOL*/ lex_push_file( const char * path, const char * mode ) { struct FILE_INFO * next = NULL; if (NULL != path) { next = lex_open(path, mode); if (NULL != next) { next->st_next = lex_stack; lex_stack = next; } } return (NULL != next); }