glcpp: Add support for lexing from a string.
The standalone binary still reads from stdin, however.
This commit is contained in:
@@ -201,3 +201,9 @@ NON_STARS_THEN_STARS [^*]*[*]+
|
||||
}
|
||||
|
||||
%%
|
||||
|
||||
void
|
||||
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader)
|
||||
{
|
||||
yy_scan_string(shader, parser->scanner);
|
||||
}
|
||||
|
@@ -159,6 +159,9 @@ glcpp_parser_destroy (glcpp_parser_t *parser);
|
||||
int
|
||||
glcpp_lex_init_extra (glcpp_parser_t *parser, yyscan_t* scanner);
|
||||
|
||||
void
|
||||
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader);
|
||||
|
||||
int
|
||||
glcpp_lex (yyscan_t scanner);
|
||||
|
||||
|
Reference in New Issue
Block a user