'How to change a parser combinator to use the GLL method

In my parser combinator library I'm making (in JavaScript), each combinator is of this form:

function combinator(parser) {
  return new Parser(parserState => {
    if (parserState.isError) return parserState;

    // ...success
    return updateParserState(parserState, index, result);

    // ...failure
    return updateParserError(parserState, errorMsg);
  });
}

I was wondering if it would be possible to convert it to the GLL parsing method? And if so, how?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source