Files
gp4/tree-sitter-p4/test/corpus/parsers.txt
T
Will Hawkins 08beba6cb1 Initial Commit
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-01-14 12:49:49 -05:00

56 lines
749 B
Plaintext

=========================
Parser (No Parameters)
=========================
parser simple() {
state testing {}
}
---
(p4program
(declaration
(parserDeclaration
(parserTypeDeclaration
(parser)
parser_name: (identifier)
)
(parserStates
(parserState
(state)
(identifier)
)
)
)
)
)
=========================
Parser (Parameters)
=========================
parser imple(bool pname) {
state testing {}
}
---
(p4program
(declaration
(parserDeclaration
(parserTypeDeclaration
(parser)
(identifier)
(nonEmptyParameterList
(parameter
(typeRef
(baseType
(bool)))
(identifier))))
(parserStates
(parserState
(state)
(identifier)
)
)
)
)
)