+ /* Copy the filename and remove its suffix */
+ strncpy(fname,filename,NAME_MAX);
+ last_period = NULL;
+ for (iter = fname; *iter; iter++) //find the last '.' char
+ if (*iter == '.')
+ last_period = iter;
+ if (last_period) //if we found one,
+ *last_period = '\0'; //truncate the string there
+ /* Register the current_filename */
+ current_filename = filename;
+
+ return lexer_lex(fname);
+}
+
+char const* lexer_get_current_filepath
+()
+{ static char current_path[PATH_MAX];
+ static char const* last_filename;
+ if ((!last_filename || last_filename != current_filename) &&
+ (realpath(current_filename, current_path) != current_path))
+ { perror("realpath: ");
+ return NULL;