7cdbee1999
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
104 lines
1.5 KiB
Plaintext
104 lines
1.5 KiB
Plaintext
=========================
|
|
Simple Annotated Declaration
|
|
=========================
|
|
@testing parser simple() {
|
|
state start {
|
|
bool l;
|
|
transition accept;
|
|
}
|
|
};
|
|
|
|
---
|
|
(p4program
|
|
(declaration
|
|
(parserDeclaration
|
|
(parserType
|
|
(annotations
|
|
(annotation
|
|
(annotation_literal)
|
|
)
|
|
)
|
|
(parser)
|
|
(identifier)
|
|
(parameters)
|
|
)
|
|
(parserStates
|
|
(parserState
|
|
(state)
|
|
(identifier)
|
|
(parserStatements
|
|
(parserStatement
|
|
(variableDeclaration
|
|
(typeRef
|
|
(baseType
|
|
(bool)
|
|
)
|
|
)
|
|
(identifier)
|
|
)
|
|
)
|
|
)
|
|
(parserTransitionStatement
|
|
(transition)
|
|
(transitionSelectionExpression
|
|
(identifier)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
=========================
|
|
Simple Annotated State
|
|
=========================
|
|
parser simple() {
|
|
@testing state start {
|
|
bool l;
|
|
transition accept;
|
|
}
|
|
};
|
|
|
|
---
|
|
(p4program
|
|
(declaration
|
|
(parserDeclaration
|
|
(parserType
|
|
(parser)
|
|
(identifier)
|
|
(parameters)
|
|
)
|
|
(parserStates
|
|
(parserState
|
|
(annotations
|
|
(annotation
|
|
(annotation_literal)
|
|
)
|
|
)
|
|
(state)
|
|
(identifier)
|
|
(parserStatements
|
|
(parserStatement
|
|
(variableDeclaration
|
|
(typeRef
|
|
(baseType
|
|
(bool)
|
|
)
|
|
)
|
|
(identifier)
|
|
)
|
|
)
|
|
)
|
|
(parserTransitionStatement
|
|
(transition)
|
|
(transitionSelectionExpression
|
|
(identifier)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|