Use custom lexer with jparsec

40 Views Asked by At

I am writing a parser for a language that has very complex lexer rules. For example, the lexer decision depends on the column at which a token appears. I wanted to use jparsec, but I can't use its internal tokenizer mechanism. Thus, I need to use my own tokenizer, that generates jparsec token.

Unfortunately, I can't find how to write code to 'give' these tokens to jparsec to do only the parsing phase.

There is already a Stack Overflow question related to this subject, but the provided solution was to use jparsec tokenizer mechanism and I really can't.

I tried different approach, like using the from method of the Parser class. But without success. Does anybody know how to use jparsec only for the parsing phase and not the lexing one?

0

There are 0 best solutions below