mpc icon indicating copy to clipboard operation
mpc copied to clipboard

support for external lexers and partial input

Open mgood7123 opened this issue 5 years ago • 1 comments

could mpc be used with external lexers (as in an actual proper lexer such as gnu lex/flex), where tokes are fed to the parser, optionally accepting a token type, if so is lookahead supported and if so how far can it look ahead and can it backtrack if a lookahead does not end up matching, and does it support a mpca_lang or similar

for example:

while(token = get_next_token()) parse(token.token, token.type);

given the rule mpc_string("abc"); and given get_next_token() returns the following

token.token = "a"
token.type = TOK_CHAR
token.token = "bc"
token.type = TOK_STR

could this partial input match the rule mpc_string("abc"); without causing the rule to terminate due to parse reading EOF in its input from the string "a" due to "a" by itself not matching the rule mpc_string("abc"); resulting in parse() to error

mgood7123 avatar Oct 19 '18 16:10 mgood7123