sv_parser_syntaxtree/declarations/
task_declarations.rs1use crate::*;
2
3#[derive(Clone, Debug, PartialEq, Node)]
6pub struct TaskDeclaration {
7 pub nodes: (Keyword, Option<Lifetime>, TaskBodyDeclaration),
8}
9
10#[derive(Clone, Debug, PartialEq, Node)]
11pub enum TaskBodyDeclaration {
12 WithoutPort(Box<TaskBodyDeclarationWithoutPort>),
13 WithPort(Box<TaskBodyDeclarationWithPort>),
14}
15
16#[derive(Clone, Debug, PartialEq, Node)]
17pub struct TaskBodyDeclarationWithoutPort {
18 pub nodes: (
19 Option<InterfaceIdentifierOrClassScope>,
20 TaskIdentifier,
21 Symbol,
22 Vec<TfItemDeclaration>,
23 Vec<StatementOrNull>,
24 Keyword,
25 Option<(Symbol, TaskIdentifier)>,
26 ),
27}
28
29#[derive(Clone, Debug, PartialEq, Node)]
30pub struct TaskBodyDeclarationWithPort {
31 pub nodes: (
32 Option<InterfaceIdentifierOrClassScope>,
33 TaskIdentifier,
34 Paren<Option<TfPortList>>,
35 Symbol,
36 Vec<BlockItemDeclaration>,
37 Vec<StatementOrNull>,
38 Keyword,
39 Option<(Symbol, TaskIdentifier)>,
40 ),
41}
42
43#[derive(Clone, Debug, PartialEq, Node)]
44pub enum TfItemDeclaration {
45 BlockItemDeclaration(Box<BlockItemDeclaration>),
46 TfPortDeclaration(Box<TfPortDeclaration>),
47}
48
49#[derive(Clone, Debug, PartialEq, Node)]
50pub struct TfPortList {
51 pub nodes: (List<Symbol, TfPortItem>,),
52}
53
54#[derive(Clone, Debug, PartialEq, Node)]
55pub struct TfPortItem {
56 pub nodes: (
57 Vec<AttributeInstance>,
58 Option<TfPortDirection>,
59 Option<Var>,
60 DataTypeOrImplicit,
61 Option<(
62 PortIdentifier,
63 Vec<VariableDimension>,
64 Option<(Symbol, Expression)>,
65 )>,
66 ),
67}
68
69#[derive(Clone, Debug, PartialEq, Node)]
70pub enum TfPortDirection {
71 PortDirection(Box<PortDirection>),
72 ConstRef(Box<(Keyword, Keyword)>),
73}
74
75#[derive(Clone, Debug, PartialEq, Node)]
76pub struct TfPortDeclaration {
77 pub nodes: (
78 Vec<AttributeInstance>,
79 TfPortDirection,
80 Option<Var>,
81 DataTypeOrImplicit,
82 ListOfTfVariableIdentifiers,
83 Symbol,
84 ),
85}
86
87#[derive(Clone, Debug, PartialEq, Node)]
88pub struct TaskPrototype {
89 pub nodes: (Keyword, TaskIdentifier, Option<Paren<Option<TfPortList>>>),
90}