1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// =======================================================================
// lib.rs
// =======================================================================
// The top-level collection of CST nodes
//! A SystemVerilog (concrete) syntax tree for representing
//! [1800-2023](https://ieeexplore.ieee.org/document/10458102) syntax.
//!
//! Each syntactic category is represented as a struct or enum with the
//! same name as appears in Annex A, with additional types as needed for
//! unnamed alternatives.
//!
//! While the tree can be treated as a normal data structure, it can
//! also be iterated across (depth-first). Iterating produces [`Node`]s,
//! which reference a specific data structure in the tree
//!
//! ```rust
//! # use scarf_syntax::*;
//! fn is_always_comb_block<'a, 'b>(node: Node<'a, 'b>) -> bool {
//! matches!(node, Node::AlwaysConstruct(AlwaysConstruct(AlwaysKeyword::AlwaysComb(_), _)))
//! }
//!
//! fn num_inferred_latches<'a>(source: &SourceText<'a>) -> i32 {
//! let mut count = 0;
//! for node in source.find(is_always_comb_block) {
//! for child_node in node.iter() {
//! if let Node::BlockingAssignment(_) = child_node {
//! count += 1;
//! }
//! }
//! }
//! count
//! }
//! ```
//!
//! Compiler directives are not supported due to their arbitrary
//! location/semantics in a syntax tree.
//!
//! ## Features
//!
//! - `lossless`: Allows for whitespace/comments to be preserved in [`Metadata`]
include!;
include!;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;