-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lexer, parser: remove manual implementation of parsing from a string
dt_lex.l has had code (in one form or another) to parse input from a string since the beginning. I rewrote it in 2013 to use a dt_input function rather than overriding YY_INPUT or simply overriding input() (which flex has never allowed), but the code was still there. This is ridiculous. flex has had code to parse from strings since 1994, so long ago that it predates any extant flex tarballs that I've been able to find, and long before DTrace's lexer was written (but of course it was written for an AT&T lex which had hardly been touched since the 1980s). It's a bit different from what DTrace is doing now -- you have to call yy_scan_string(), which gives you back a yy_buffer_state handle that you free with yy_delete_buffer() -- but it works, and it means we can rip out half the code in dt_input, leaving only the code to do buffered reads from actual files. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
1 parent
03ac5b8
commit c5f17d9
Showing
4 changed files
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters