-EquinoX- 0 Newbie Poster

My problem is this, whenever I give this code an input of
<!--, it always runs it through the tag definition first that I made, instead actually i want it to run through the <!-- in the rule part that I made (the one that BEGINS S1 after that), how do I make so that when the input is <!--, it's recognized at the right part?? If say I erase the tag rule ( {tag}), then it can parse the input correctly, however I can't do this to solve the problem as the input can be a <!-- and it can also be a tag....

this is like an overlapping rule problem, on which ones is used first, however the tag rule always dominates here. It always applies the rule tag whenever it sees a "<" bla bla bla, it ignores the rule I made on the <!-- and so on. Please help me.

%x S1 

print_nw  [-!"#$%&'()*+,./0-9:;<=?@A-Z\[\\\]^_`a-z{|}~]
tag <{print_nw}[^>]*>

%%

"<!--"             BEGIN(S1);
/* some other code here */

{tag}            ;
%%
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.