Hi all,
I want to modify a ParserState node in a new pass in frontend. I used preorder in IR::ParserState by using Transform. For example, for one node I have
state parse_udp { packet.extract<udp_t>(hdr.udp); accept;}
and I want to change it to
state parse_tcp {packet.extract<tcp_t>(hdr.tcp); accept;}
so I checked ParserState class, we have node->name which is parse_udp in my example and I try to change it to parse_tcp by
node->name = new IR::ParserValueSet::ID (“parse_tcp”); or
node->name = new IR::ID(“parse_tcp”);
But I have some errors. Could you give me some hints?
Also, in ParserState class I could not find any methods or variables related to packet.extract<udp_t>(hdr.udp). please let me know how I can access to that.