Antlr4 channels behavior -



Antlr4 channels behavior -

i have next construct:

mode pass_through; end_literal: pass_through_char* '{/literal}' -> popmode; pass_through_char: .+ -> channel( text );

when mode gets executed end_literal pass_through_chars pre-appended it. have though pass_through_char have been on text channel , end_literal have been '{/literal}

is behavior correct?

hard why behaved say, compound/conflicting utilize of * , + on , in pass_through_char root cause. below think trying accomplish.

start_literal: '{/literal}' -> pushmode(pass_through); mode pass_through; end_literal: '{/literal}' -> popmode; pass_through_char: . -> more, channel( text );

updated: have not tried exactly, utilize of 'more' alternative may (should) collapse each string of pass_through_char single token.

antlr4 behavior channels

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -