12 May
2013
12 May
'13
11:48 a.m.
Hi, I want to replace a flex lexer with boost.spirit.lex. We implemented an include-like functionality inside the lexer semantic actions: include { BEGIN(incl) } <EOF> { leaveCurrentFile(); popScannerState(); } <incl> { ".+" { openNewFile(); pushScannerState(); BEGIN(INITIAL); } } Is there a way to do that in lexertl? I thought about extending the spirit file_iterator but found that unwieldy. So I now consider adding a semantic actions that are allowed to change lex::_eoi and the ability to have a eoi token or just a semantic action to handle eoi. Is that a reasonable way of implementing that? regards Andreas