Files
gp4/tree-sitter-p4/test/corpus/control.txt
T
Will Hawkins b97aa1af72
Continuous Integration / Grammar Tests (push) Has been cancelled
Continuous Integration / Library Tests (push) Has been cancelled
Continuous Integration / Library Format Tests (push) Has been cancelled
parser, compiler: Support Table Actions
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-30 05:38:29 -04:00

131 lines
1.8 KiB
Plaintext

=========================
Simple Control Declaration
=========================
control simple() {
action a() {
}
table t {
key = {
x: exact;
}
}
apply {
}
};
---
(p4program
(declaration
(control_declaration
(control)
(identifier)
(parameters)
(action_declaration
(action)
(identifier)
(parameters)
(blockStatement)
)
(table_declaration
(table)
(identifier)
(table_property_list
(table_keys
(key)
(table_key_entry
(keysetExpression
(expression
(simple_expression
(identifier)
)
)
)
(table_key_match_type
(exact)
)
)
)
)
)
(apply_statement
(apply)
(blockStatement)
)
)
)
)
=========================
Simple Control Declaration With Actions
=========================
control simple() {
action a() {
}
action b() {
}
table t {
key = {
x: exact;
}
actions = {
a;
b;
}
}
apply {
}
};
---
(p4program
(declaration
(control_declaration
(control)
(identifier)
(parameters)
(action_declaration
(action)
(identifier)
(parameters)
(blockStatement)
)
(action_declaration
(action)
(identifier)
(parameters)
(blockStatement)
)
(table_declaration
(table)
(identifier)
(table_property_list
(table_keys
(key)
(table_key_entry
(keysetExpression
(expression
(simple_expression
(identifier)
)
)
)
(table_key_match_type
(exact)
)
)
)
(table_actions
(actions)
(identifier)
(identifier)
)
)
)
(apply_statement
(apply)
(blockStatement)
)
)
)
)