P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::IR::Traversal::Index Struct Reference

Select an index of a integer-indexed sub-object. This is useful e.g. to select first parameter of a method call and in similar cases involving IR::Vector or IR::IndexedVector. More...

#include <ir-traversal.h>

Public Member Functions

 Index (size_t value)
 

Public Attributes

size_t value
 

Detailed Description

Select an index of a integer-indexed sub-object. This is useful e.g. to select first parameter of a method call and in similar cases involving IR::Vector or IR::IndexedVector.

modify(mce, &IR::MethodCallExpression::arguments, Index(0), &IR::Argument::expression,
Assign(val))
A selector used at the end of selector chain to assign to the current sub-object. e....
Definition ir-traversal.h:36
Select an index of a integer-indexed sub-object. This is useful e.g. to select first parameter of a m...
Definition ir-traversal.h:50

This snippet assigns val into the first argument of a method call.