Apply nom-packrat
This commit is contained in:
parent
81e5a8b976
commit
1d22da04a1
@ -17,9 +17,11 @@ trace = []
|
||||
|
||||
[dependencies]
|
||||
nom = "5.0.0"
|
||||
nom_locate = { git = "https://github.com/fflorent/nom_locate" }
|
||||
#nom_locate = { git = "https://github.com/fflorent/nom_locate" }
|
||||
nom_locate = { path = "../nom_locate" }
|
||||
str-concat = "*"
|
||||
sv-parser-macro = { path = "./sv-parser-macro" }
|
||||
nom-packrat = { path = "../nom-packrat/nom-packrat" }
|
||||
|
||||
[build-dependencies]
|
||||
walkdir = "2"
|
||||
|
20
build.rs
20
build.rs
@ -10,9 +10,15 @@ fn main() {
|
||||
let dest = Path::new(&out_dir).join("any_node.rs");
|
||||
let mut out = File::create(&dest).unwrap();
|
||||
|
||||
let _ = write!(out, "#[derive(Debug, Clone, AnyNode)]\n");
|
||||
let _ = write!(out, "pub enum AnyNode<'a> {{\n");
|
||||
let _ = write!(out, " Locate(&'a Locate),\n");
|
||||
let mut ref_node = String::new();
|
||||
ref_node = format!("{}#[derive(Debug, Clone, RefNode)]\n", ref_node);
|
||||
ref_node = format!("{}pub enum RefNode<'a> {{\n", ref_node);
|
||||
ref_node = format!("{} Locate(&'a Locate),\n", ref_node);
|
||||
|
||||
let mut any_node = String::new();
|
||||
any_node = format!("{}#[derive(Debug, Clone, AnyNode)]\n", any_node);
|
||||
any_node = format!("{}pub enum AnyNode {{\n", any_node);
|
||||
any_node = format!("{} Locate(Locate),\n", any_node);
|
||||
|
||||
let re_node = Regex::new(r"#\[derive.*Node.*\]").unwrap();
|
||||
|
||||
@ -26,7 +32,8 @@ fn main() {
|
||||
let line = line.unwrap();
|
||||
if hit_node {
|
||||
let name = line.split_whitespace().nth(2).unwrap().replace("<'a>", "");
|
||||
let _ = write!(out, " {}(&'a {}),\n", name, name);
|
||||
ref_node = format!("{} {}(&'a {}),\n", ref_node, name, name);
|
||||
any_node = format!("{} {}({}),\n", any_node, name, name);
|
||||
hit_node = false;
|
||||
}
|
||||
if re_node.is_match(&line) {
|
||||
@ -36,5 +43,8 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
let _ = write!(out, "}}\n");
|
||||
ref_node = format!("{}}}\n", ref_node);
|
||||
any_node = format!("{}}}\n", any_node);
|
||||
let _ = write!(out, "{}", ref_node);
|
||||
let _ = write!(out, "{}", any_node);
|
||||
}
|
||||
|
@ -1,20 +1,21 @@
|
||||
use crate::ast::*;
|
||||
use crate::parser::*;
|
||||
use core::convert::TryFrom;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/any_node.rs"));
|
||||
|
||||
pub struct AnyNodes<'a>(pub Vec<AnyNode<'a>>);
|
||||
pub struct RefNodes<'a>(pub Vec<RefNode<'a>>);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
pub struct Iter<'a> {
|
||||
pub next: AnyNodes<'a>,
|
||||
pub next: RefNodes<'a>,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Iter<'a> {
|
||||
type Item = AnyNode<'a>;
|
||||
type Item = RefNode<'a>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let ret = self.next.0.pop();
|
||||
@ -29,21 +30,21 @@ impl<'a> Iterator for Iter<'a> {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
impl<'a> From<Vec<AnyNode<'a>>> for AnyNodes<'a> {
|
||||
fn from(x: Vec<AnyNode<'a>>) -> Self {
|
||||
AnyNodes(x)
|
||||
impl<'a> From<Vec<RefNode<'a>>> for RefNodes<'a> {
|
||||
fn from(x: Vec<RefNode<'a>>) -> Self {
|
||||
RefNodes(x)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Locate> for AnyNodes<'a> {
|
||||
impl<'a> From<&'a Locate> for RefNodes<'a> {
|
||||
fn from(x: &'a Locate) -> Self {
|
||||
vec![AnyNode::Locate(x)].into()
|
||||
vec![RefNode::Locate(x)].into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a> From<&'a Vec<T>> for AnyNodes<'a>
|
||||
impl<'a, T: 'a> From<&'a Vec<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Vec<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -54,9 +55,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a> From<&'a Option<T>> for AnyNodes<'a>
|
||||
impl<'a, T: 'a> From<&'a Option<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Option<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -67,9 +68,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a> From<&'a (T0,)> for AnyNodes<'a>
|
||||
impl<'a, T0: 'a> From<&'a (T0,)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0,)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -79,10 +80,10 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a> From<&'a (T0, T1)> for AnyNodes<'a>
|
||||
impl<'a, T0: 'a, T1: 'a> From<&'a (T0, T1)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -93,11 +94,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a> From<&'a (T0, T1, T2)> for AnyNodes<'a>
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a> From<&'a (T0, T1, T2)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -109,12 +110,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a> From<&'a (T0, T1, T2, T3)> for AnyNodes<'a>
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a> From<&'a (T0, T1, T2, T3)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -127,13 +128,13 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a> From<&'a (T0, T1, T2, T3, T4)> for AnyNodes<'a>
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a> From<&'a (T0, T1, T2, T3, T4)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -148,14 +149,14 @@ where
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a> From<&'a (T0, T1, T2, T3, T4, T5)>
|
||||
for AnyNodes<'a>
|
||||
for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -171,15 +172,15 @@ where
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6)> for AnyNodes<'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T6: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
&'a T6: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5, T6)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -196,16 +197,16 @@ where
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7)> for AnyNodes<'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T6: Into<AnyNodes<'a>>,
|
||||
&'a T7: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
&'a T6: Into<RefNodes<'a>>,
|
||||
&'a T7: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5, T6, T7)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -223,17 +224,17 @@ where
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8)> for AnyNodes<'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T6: Into<AnyNodes<'a>>,
|
||||
&'a T7: Into<AnyNodes<'a>>,
|
||||
&'a T8: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
&'a T6: Into<RefNodes<'a>>,
|
||||
&'a T7: Into<RefNodes<'a>>,
|
||||
&'a T8: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -252,18 +253,18 @@ where
|
||||
}
|
||||
|
||||
impl<'a, T0: 'a, T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a, T9: 'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for AnyNodes<'a>
|
||||
From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T6: Into<AnyNodes<'a>>,
|
||||
&'a T7: Into<AnyNodes<'a>>,
|
||||
&'a T8: Into<AnyNodes<'a>>,
|
||||
&'a T9: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
&'a T6: Into<RefNodes<'a>>,
|
||||
&'a T7: Into<RefNodes<'a>>,
|
||||
&'a T8: Into<RefNodes<'a>>,
|
||||
&'a T9: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -295,19 +296,19 @@ impl<
|
||||
T8: 'a,
|
||||
T9: 'a,
|
||||
T10: 'a,
|
||||
> From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for AnyNodes<'a>
|
||||
> From<&'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for RefNodes<'a>
|
||||
where
|
||||
&'a T0: Into<AnyNodes<'a>>,
|
||||
&'a T1: Into<AnyNodes<'a>>,
|
||||
&'a T2: Into<AnyNodes<'a>>,
|
||||
&'a T3: Into<AnyNodes<'a>>,
|
||||
&'a T4: Into<AnyNodes<'a>>,
|
||||
&'a T5: Into<AnyNodes<'a>>,
|
||||
&'a T6: Into<AnyNodes<'a>>,
|
||||
&'a T7: Into<AnyNodes<'a>>,
|
||||
&'a T8: Into<AnyNodes<'a>>,
|
||||
&'a T9: Into<AnyNodes<'a>>,
|
||||
&'a T10: Into<AnyNodes<'a>>,
|
||||
&'a T0: Into<RefNodes<'a>>,
|
||||
&'a T1: Into<RefNodes<'a>>,
|
||||
&'a T2: Into<RefNodes<'a>>,
|
||||
&'a T3: Into<RefNodes<'a>>,
|
||||
&'a T4: Into<RefNodes<'a>>,
|
||||
&'a T5: Into<RefNodes<'a>>,
|
||||
&'a T6: Into<RefNodes<'a>>,
|
||||
&'a T7: Into<RefNodes<'a>>,
|
||||
&'a T8: Into<RefNodes<'a>>,
|
||||
&'a T9: Into<RefNodes<'a>>,
|
||||
&'a T10: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
@ -327,15 +328,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Paren<T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Paren<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Paren<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let (a, b, c) = &x.nodes;
|
||||
let mut a: AnyNodes<'a> = a.into();
|
||||
let mut c: AnyNodes<'a> = c.into();
|
||||
let mut a: RefNodes<'a> = a.into();
|
||||
let mut c: RefNodes<'a> = c.into();
|
||||
ret.append(&mut a.0);
|
||||
ret.append(&mut b.into().0);
|
||||
ret.append(&mut c.0);
|
||||
@ -343,15 +344,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Brace<T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Brace<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Brace<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let (a, b, c) = &x.nodes;
|
||||
let mut a: AnyNodes<'a> = a.into();
|
||||
let mut c: AnyNodes<'a> = c.into();
|
||||
let mut a: RefNodes<'a> = a.into();
|
||||
let mut c: RefNodes<'a> = c.into();
|
||||
ret.append(&mut a.0);
|
||||
ret.append(&mut b.into().0);
|
||||
ret.append(&mut c.0);
|
||||
@ -359,15 +360,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Bracket<T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Bracket<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Bracket<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let (a, b, c) = &x.nodes;
|
||||
let mut a: AnyNodes<'a> = a.into();
|
||||
let mut c: AnyNodes<'a> = c.into();
|
||||
let mut a: RefNodes<'a> = a.into();
|
||||
let mut c: RefNodes<'a> = c.into();
|
||||
ret.append(&mut a.0);
|
||||
ret.append(&mut b.into().0);
|
||||
ret.append(&mut c.0);
|
||||
@ -375,15 +376,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a ApostropheBrace<T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a ApostropheBrace<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a ApostropheBrace<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let (a, b, c) = &x.nodes;
|
||||
let mut a: AnyNodes<'a> = a.into();
|
||||
let mut c: AnyNodes<'a> = c.into();
|
||||
let mut a: RefNodes<'a> = a.into();
|
||||
let mut c: RefNodes<'a> = c.into();
|
||||
ret.append(&mut a.0);
|
||||
ret.append(&mut b.into().0);
|
||||
ret.append(&mut c.0);
|
||||
@ -391,28 +392,28 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T, U> From<&'a List<T, U>> for AnyNodes<'a>
|
||||
impl<'a, T, U> From<&'a List<T, U>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a U: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
&'a U: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a List<T, U>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let (t, u) = &x.nodes;
|
||||
let mut u: AnyNodes<'a> = u.into();
|
||||
let mut u: RefNodes<'a> = u.into();
|
||||
ret.append(&mut t.into().0);
|
||||
ret.append(&mut u.0);
|
||||
ret.into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a> From<&'a Box<T>> for AnyNodes<'a>
|
||||
impl<'a, T: 'a> From<&'a Box<T>> for RefNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
&'a T: Into<RefNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Box<T>) -> Self {
|
||||
let mut ret = Vec::new();
|
||||
let mut x: AnyNodes<'a> = x.into();
|
||||
let mut x: RefNodes<'a> = x.into();
|
||||
ret.append(&mut x.0);
|
||||
ret.into()
|
||||
}
|
||||
|
@ -2,11 +2,11 @@ use crate::ast::*;
|
||||
use crate::parser::*;
|
||||
|
||||
pub trait Node<'a> {
|
||||
fn next(&'a self) -> AnyNodes<'a>;
|
||||
fn next(&'a self) -> RefNodes<'a>;
|
||||
}
|
||||
|
||||
impl<'a> Node<'a> for Locate {
|
||||
fn next(&'a self) -> AnyNodes<'a> {
|
||||
fn next(&'a self) -> RefNodes<'a> {
|
||||
vec![].into()
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
#![recursion_limit = "128"]
|
||||
pub mod ast;
|
||||
pub mod parser;
|
||||
|
||||
use nom_packrat::storage;
|
||||
|
||||
storage!(ast::AnyNode);
|
||||
|
@ -7,13 +7,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssertionItem {
|
||||
Concurrent(ConcurrentAssertionItem),
|
||||
Immediate(DeferredImmediateAssetionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DeferredImmediateAssetionItem {
|
||||
pub nodes: (
|
||||
Option<(BlockIdentifier, Symbol)>,
|
||||
@ -21,64 +21,64 @@ pub struct DeferredImmediateAssetionItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProceduralAssertionStatement {
|
||||
Concurrent(ConcurrentAssertionStatement),
|
||||
Immediate(ImmediateAssetionStatement),
|
||||
Checker(CheckerInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImmediateAssetionStatement {
|
||||
Simple(SimpleImmediateAssertionStatement),
|
||||
Deferred(DeferredImmediateAssertionStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SimpleImmediateAssertionStatement {
|
||||
Assert(SimpleImmediateAssertStatement),
|
||||
Assume(SimpleImmediateAssumeStatement),
|
||||
Cover(SimpleImmediateCoverStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimpleImmediateAssertStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimpleImmediateAssumeStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimpleImmediateCoverStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DeferredImmediateAssertionStatement {
|
||||
Assert(DeferredImmediateAssertStatement),
|
||||
Assume(DeferredImmediateAssumeStatement),
|
||||
Cover(DeferredImmediateCoverStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DeferredImmediateAssertStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DeferredImmediateAssumeStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DeferredImmediateCoverStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssertTiming {
|
||||
Zero(Symbol),
|
||||
Final(Keyword),
|
||||
|
@ -8,14 +8,14 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CaseStatement {
|
||||
Normal(CaseStatementNormal),
|
||||
Matches(CaseStatementMatches),
|
||||
Inside(CaseStatementInside),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseStatementNormal {
|
||||
pub nodes: (
|
||||
Option<UniquePriority>,
|
||||
@ -27,7 +27,7 @@ pub struct CaseStatementNormal {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseStatementMatches {
|
||||
pub nodes: (
|
||||
Option<UniquePriority>,
|
||||
@ -40,7 +40,7 @@ pub struct CaseStatementMatches {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseStatementInside {
|
||||
pub nodes: (
|
||||
Option<UniquePriority>,
|
||||
@ -53,41 +53,41 @@ pub struct CaseStatementInside {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CaseKeyword {
|
||||
Case(Keyword),
|
||||
Casez(Keyword),
|
||||
Casex(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CaseItem {
|
||||
NonDefault(CaseItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseItemNondefault {
|
||||
pub nodes: (List<Symbol, CaseItemExpression>, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CasePatternItem {
|
||||
NonDefault(CasePatternItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CasePatternItemNondefault {
|
||||
pub nodes: (
|
||||
Pattern,
|
||||
@ -97,38 +97,38 @@ pub struct CasePatternItemNondefault {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CaseInsideItem {
|
||||
NonDefault(CaseInsideItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseInsideItemNondefault {
|
||||
pub nodes: (OpenRangeList, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseItemExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RandcaseStatement {
|
||||
pub nodes: (Keyword, RandcaseItem, Vec<RandcaseItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RandcaseItem {
|
||||
pub nodes: (Expression, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OpenRangeList {
|
||||
pub nodes: (List<Symbol, OpenValueRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OpenValueRange {
|
||||
pub nodes: (ValueRange,),
|
||||
}
|
||||
|
@ -8,13 +8,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClockingDeclaration {
|
||||
Local(ClockingDeclarationLocal),
|
||||
Global(ClockingDeclarationGlobal),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDeclarationLocal {
|
||||
pub nodes: (
|
||||
Option<Default>,
|
||||
@ -28,12 +28,12 @@ pub struct ClockingDeclarationLocal {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Default {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDeclarationGlobal {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -46,67 +46,67 @@ pub struct ClockingDeclarationGlobal {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClockingEvent {
|
||||
Identifier(ClockingEventIdentifier),
|
||||
Expression(ClockingEventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingEventIdentifier {
|
||||
pub nodes: (Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingEventExpression {
|
||||
pub nodes: (Symbol, Paren<EventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClockingItem {
|
||||
Default(ClockingItemDefault),
|
||||
Direction(ClockingItemDirection),
|
||||
Assertion(ClockingItemAssertion),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingItemDefault {
|
||||
pub nodes: (Keyword, DefaultSkew, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingItemDirection {
|
||||
pub nodes: (ClockingDirection, ListOfClockingDeclAssign, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingItemAssertion {
|
||||
pub nodes: (Vec<AttributeInstance>, AssertionItemDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DefaultSkew {
|
||||
Input(DefaultSkewInput),
|
||||
Output(DefaultSkewOutput),
|
||||
InputOutput(DefaultSkewInputOutput),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DefaultSkewInput {
|
||||
pub nodes: (Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DefaultSkewOutput {
|
||||
pub nodes: (Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DefaultSkewInputOutput {
|
||||
pub nodes: (Keyword, ClockingSkew, Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClockingDirection {
|
||||
Input(ClockingDirectionInput),
|
||||
Output(ClockingDirectionOutput),
|
||||
@ -114,75 +114,75 @@ pub enum ClockingDirection {
|
||||
Inout(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDirectionInput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDirectionOutput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDirectionInputOutput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>, Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfClockingDeclAssign {
|
||||
pub nodes: (List<Symbol, ClockingDeclAssign>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDeclAssign {
|
||||
pub nodes: (SignalIdentifier, Option<(Symbol, Expression)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClockingSkew {
|
||||
Edge(ClockingSkewEdge),
|
||||
DelayControl(DelayControl),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingSkewEdge {
|
||||
pub nodes: (EdgeIdentifier, Option<DelayControl>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingDrive {
|
||||
pub nodes: (ClockvarExpression, Symbol, Option<CycleDelay>, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CycleDelay {
|
||||
Integral(CycleDelayIntegral),
|
||||
Identifier(CycleDelayIdentifier),
|
||||
Expression(CycleDelayExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayIntegral {
|
||||
pub nodes: (Symbol, IntegralNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayIdentifier {
|
||||
pub nodes: (Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayExpression {
|
||||
pub nodes: (Symbol, Paren<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Clockvar {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockvarExpression {
|
||||
pub nodes: (Clockvar, Select),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConditionalStatement {
|
||||
pub nodes: (
|
||||
Option<UniquePriority>,
|
||||
@ -20,25 +20,25 @@ pub struct ConditionalStatement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UniquePriority {
|
||||
Unique(Keyword),
|
||||
Unique0(Keyword),
|
||||
Priority(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CondPredicate {
|
||||
pub nodes: (List<Symbol, ExpressionOrCondPattern>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ExpressionOrCondPattern {
|
||||
Expression(Expression),
|
||||
CondPattern(CondPattern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CondPattern {
|
||||
pub nodes: (Expression, Keyword, Pattern),
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ContinuousAssign {
|
||||
Net(ContinuousAssignNet),
|
||||
Variable(ContinuousAssignVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ContinuousAssignNet {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -23,7 +23,7 @@ pub struct ContinuousAssignNet {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ContinuousAssignVariable {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -33,17 +33,17 @@ pub struct ContinuousAssignVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfNetAssignments {
|
||||
pub nodes: (List<Symbol, NetAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfVariableAssignments {
|
||||
pub nodes: (List<Symbol, VariableAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetAlias {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -54,7 +54,7 @@ pub struct NetAlias {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetAssignment {
|
||||
pub nodes: (NetLvalue, Symbol, Expression),
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LoopStatement {
|
||||
Forever(LoopStatementForever),
|
||||
Repeat(LoopStatementRepeat),
|
||||
@ -17,22 +17,22 @@ pub enum LoopStatement {
|
||||
Foreach(LoopStatementForeach),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementForever {
|
||||
pub nodes: (Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementWhile {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementFor {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -47,12 +47,12 @@ pub struct LoopStatementFor {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementDoWhile {
|
||||
pub nodes: (Keyword, StatementOrNull, Keyword, Paren<Expression>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopStatementForeach {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -61,18 +61,18 @@ pub struct LoopStatementForeach {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ForInitialization {
|
||||
ListOfVariableAssignments(ListOfVariableAssignments),
|
||||
Declaration(ForInitializationDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ForInitializationDeclaration {
|
||||
pub nodes: (List<Symbol, ForVariableDeclaration>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ForVariableDeclaration {
|
||||
pub nodes: (
|
||||
Option<Var>,
|
||||
@ -81,24 +81,24 @@ pub struct ForVariableDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Var {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ForStep {
|
||||
pub nodes: (List<Symbol, ForStepAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ForStepAssignment {
|
||||
OperatorAssignment(OperatorAssignment),
|
||||
IncOrDecExpression(IncOrDecExpression),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopVariables {
|
||||
pub nodes: (List<Symbol, Option<IndexVariableIdentifier>>,),
|
||||
}
|
||||
|
@ -8,18 +8,18 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ActionBlock {
|
||||
StatementOrNull(StatementOrNull),
|
||||
Else(ActionBlockElse),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ActionBlockElse {
|
||||
pub nodes: (Option<Statement>, Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SeqBlock {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -31,7 +31,7 @@ pub struct SeqBlock {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParBlock {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -43,7 +43,7 @@ pub struct ParBlock {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum JoinKeyword {
|
||||
Join(Keyword),
|
||||
JoinAny(Keyword),
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Pattern {
|
||||
Variable(Box<PatternVariable>),
|
||||
Asterisk(Symbol),
|
||||
@ -17,27 +17,27 @@ pub enum Pattern {
|
||||
IdentifierList(Box<PatternIdentifierList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PatternVariable {
|
||||
pub nodes: (Symbol, VariableIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PatternTagged {
|
||||
pub nodes: (Keyword, MemberIdentifier, Option<Pattern>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PatternList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, Pattern>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PatternIdentifierList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (MemberIdentifier, Symbol, Pattern)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssignmentPattern {
|
||||
List(AssignmentPatternList),
|
||||
Structure(AssignmentPatternStructure),
|
||||
@ -45,50 +45,50 @@ pub enum AssignmentPattern {
|
||||
Repeat(AssignmentPatternRepeat),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternStructure {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (StructurePatternKey, Symbol, Expression)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternArray {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (ArrayPatternKey, Symbol, Expression)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternRepeat {
|
||||
pub nodes: (ApostropheBrace<(ConstantExpression, Brace<List<Symbol, Expression>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum StructurePatternKey {
|
||||
MemberIdentifier(MemberIdentifier),
|
||||
AssignmentPatternKey(AssignmentPatternKey),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ArrayPatternKey {
|
||||
ConstantExpression(ConstantExpression),
|
||||
AssignmentPatternKey(AssignmentPatternKey),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssignmentPatternKey {
|
||||
SimpleType(SimpleType),
|
||||
Default(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternExpression {
|
||||
pub nodes: (Option<AssignmentPatternExpressionType>, AssignmentPattern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssignmentPatternExpressionType {
|
||||
PsTypeIdentifier(PsTypeIdentifier),
|
||||
PsParameterIdentifier(PsParameterIdentifier),
|
||||
@ -96,17 +96,17 @@ pub enum AssignmentPatternExpressionType {
|
||||
TypeReference(TypeReference),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantAssignmentPatternExpression {
|
||||
pub nodes: (AssignmentPatternExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternNetLvalue {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, NetLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentPatternVariableLvalue {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, VariableLvalue>>,),
|
||||
}
|
||||
@ -253,7 +253,7 @@ pub fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn assignment_pattern_expression(s: Span) -> IResult<Span, AssignmentPatternExpression> {
|
||||
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
||||
let (s, b) = assignment_pattern(s)?;
|
||||
@ -280,7 +280,7 @@ pub fn assignment_pattern_expression_type(
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_assignment_pattern_expression(
|
||||
s: Span,
|
||||
) -> IResult<Span, ConstantAssignmentPatternExpression> {
|
||||
|
@ -6,17 +6,17 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InitialConstruct {
|
||||
pub nodes: (Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AlwaysConstruct {
|
||||
pub nodes: (AlwaysKeyword, Statement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AlwaysKeyword {
|
||||
Always(Keyword),
|
||||
AlwaysComb(Keyword),
|
||||
@ -24,12 +24,12 @@ pub enum AlwaysKeyword {
|
||||
AlwaysFf(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FinalConstruct {
|
||||
pub nodes: (Keyword, FunctionStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BlockingAssignment {
|
||||
Variable(BlockingAssignmentVariable),
|
||||
NonrangeVariable(BlockingAssignmentNonrangeVariable),
|
||||
@ -37,7 +37,7 @@ pub enum BlockingAssignment {
|
||||
OperatorAssignment(OperatorAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockingAssignmentVariable {
|
||||
pub nodes: (
|
||||
VariableLvalue,
|
||||
@ -47,12 +47,12 @@ pub struct BlockingAssignmentVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockingAssignmentNonrangeVariable {
|
||||
pub nodes: (NonrangeVariableLvalue, Symbol, DynamicArrayNew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockingAssignmentHierarchicalVariable {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope>,
|
||||
@ -63,17 +63,17 @@ pub struct BlockingAssignmentHierarchicalVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OperatorAssignment {
|
||||
pub nodes: (VariableLvalue, AssignmentOperator, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssignmentOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonblockingAssignment {
|
||||
pub nodes: (
|
||||
VariableLvalue,
|
||||
@ -83,7 +83,7 @@ pub struct NonblockingAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProceduralContinuousAssignment {
|
||||
Assign(ProceduralContinuousAssignmentAssign),
|
||||
Deassign(ProceduralContinuousAssignmentDeassign),
|
||||
@ -93,37 +93,37 @@ pub enum ProceduralContinuousAssignment {
|
||||
ReleaseNet(ProceduralContinuousAssignmentReleaseNet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentAssign {
|
||||
pub nodes: (Keyword, VariableAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentDeassign {
|
||||
pub nodes: (Keyword, VariableLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentForceVariable {
|
||||
pub nodes: (Keyword, VariableAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentForceNet {
|
||||
pub nodes: (Keyword, NetAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentReleaseVariable {
|
||||
pub nodes: (Keyword, VariableLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentReleaseNet {
|
||||
pub nodes: (Keyword, NetLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableAssignment {
|
||||
pub nodes: (VariableLvalue, Symbol, Expression),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RandsequenceStatement {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -19,7 +19,7 @@ pub struct RandsequenceStatement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Production {
|
||||
pub nodes: (
|
||||
Option<DataTypeOrVoid>,
|
||||
@ -31,7 +31,7 @@ pub struct Production {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsRule {
|
||||
pub nodes: (
|
||||
RsProductionList,
|
||||
@ -39,18 +39,18 @@ pub struct RsRule {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RsProductionList {
|
||||
Prod(RsProductionListProd),
|
||||
Join(RsProductionListJoin),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsProductionListProd {
|
||||
pub nodes: (RsProd, Vec<RsProd>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsProductionListJoin {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -62,24 +62,24 @@ pub struct RsProductionListJoin {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum WeightSpecification {
|
||||
IntegralNumber(IntegralNumber),
|
||||
PsIdentifier(PsIdentifier),
|
||||
Expression(WeightSpecificationExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WeightSpecificationExpression {
|
||||
pub nodes: (Paren<Expression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsCodeBlock {
|
||||
pub nodes: (Brace<(Vec<DataDeclaration>, Vec<StatementOrNull>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RsProd {
|
||||
ProductionItem(ProductionItem),
|
||||
RsCodeBlock(RsCodeBlock),
|
||||
@ -88,12 +88,12 @@ pub enum RsProd {
|
||||
RsCase(RsCase),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProductionItem {
|
||||
pub nodes: (ProductionIdentifier, Option<Paren<ListOfArguments>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsIfElse {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -103,12 +103,12 @@ pub struct RsIfElse {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, ProductionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsCase {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -119,13 +119,13 @@ pub struct RsCase {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RsCaseItem {
|
||||
NonDefault(RsCaseItemNondefault),
|
||||
Default(RsCaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsCaseItemNondefault {
|
||||
pub nodes: (
|
||||
List<Symbol, CaseItemExpression>,
|
||||
@ -135,7 +135,7 @@ pub struct RsCaseItemNondefault {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RsCaseItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, ProductionItem, Symbol),
|
||||
}
|
||||
|
@ -8,18 +8,18 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum StatementOrNull {
|
||||
Statement(Statement),
|
||||
Attribute(StatementOrNullAttribute),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StatementOrNullAttribute {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Statement {
|
||||
pub nodes: (
|
||||
Option<(BlockIdentifier, Symbol)>,
|
||||
@ -28,7 +28,7 @@ pub struct Statement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum StatementItem {
|
||||
BlockingAssignment(Box<(BlockingAssignment, Symbol)>),
|
||||
NonblockingAssignment(Box<(NonblockingAssignment, Symbol)>),
|
||||
@ -52,23 +52,23 @@ pub enum StatementItem {
|
||||
ExpectPropertyStatement(Box<ExpectPropertyStatement>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionStatement {
|
||||
pub nodes: (Statement,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum FunctionStatementOrNull {
|
||||
Statement(FunctionStatement),
|
||||
Attribute(FunctionStatementOrNullAttribute),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionStatementOrNullAttribute {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableIdentifierList {
|
||||
pub nodes: (List<Symbol, VariableIdentifier>,),
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SubroutineCallStatement {
|
||||
SubroutineCall((SubroutineCall, Symbol)),
|
||||
Function(SubroutineCallStatementFunction),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SubroutineCallStatementFunction {
|
||||
pub nodes: (Keyword, Symbol, Paren<FunctionSubroutineCall>, Symbol),
|
||||
}
|
||||
|
@ -7,40 +7,40 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProceduralTimingControlStatement {
|
||||
pub nodes: (ProceduralTimingControl, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DelayOrEventControl {
|
||||
Delay(DelayControl),
|
||||
Event(EventControl),
|
||||
Repeat(DelayOrEventControlRepeat),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DelayOrEventControlRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, EventControl),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DelayControl {
|
||||
Delay(DelayControlDelay),
|
||||
Mintypmax(DelayControlMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DelayControlDelay {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DelayControlMintypmax {
|
||||
pub nodes: (Symbol, Paren<MintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EventControl {
|
||||
EventIdentifier(EventControlEventIdentifier),
|
||||
EventExpression(EventControlEventExpression),
|
||||
@ -49,32 +49,32 @@ pub enum EventControl {
|
||||
SequenceIdentifier(EventControlSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventControlEventIdentifier {
|
||||
pub nodes: (Symbol, HierarchicalEventIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventControlEventExpression {
|
||||
pub nodes: (Symbol, Paren<EventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventControlAsterisk {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventControlParenAsterisk {
|
||||
pub nodes: (Symbol, Paren<Symbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventControlSequenceIdentifier {
|
||||
pub nodes: (Symbol, PsOrHierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EventExpression {
|
||||
Expression(Box<EventExpressionExpression>),
|
||||
Sequence(Box<EventExpressionSequence>),
|
||||
@ -83,7 +83,7 @@ pub enum EventExpression {
|
||||
Paren(Box<EventExpressionParen>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventExpressionExpression {
|
||||
pub nodes: (
|
||||
Option<EdgeIdentifier>,
|
||||
@ -92,73 +92,73 @@ pub struct EventExpressionExpression {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventExpressionSequence {
|
||||
pub nodes: (SequenceInstance, Option<(Keyword, Expression)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventExpressionOr {
|
||||
pub nodes: (EventExpression, Keyword, EventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventExpressionComma {
|
||||
pub nodes: (EventExpression, Symbol, EventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventExpressionParen {
|
||||
pub nodes: (Paren<EventExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProceduralTimingControl {
|
||||
DelayControl(DelayControl),
|
||||
EventControl(EventControl),
|
||||
CycleDelay(CycleDelay),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum JumpStatement {
|
||||
Return(JumpStatementReturn),
|
||||
Break(JumpStatementBreak),
|
||||
Continue(JumpStatementContinue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct JumpStatementReturn {
|
||||
pub nodes: (Keyword, Option<Expression>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct JumpStatementBreak {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct JumpStatementContinue {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum WaitStatement {
|
||||
Wait(WaitStatementWait),
|
||||
Fork(WaitStatementFork),
|
||||
Order(WaitStatementOrder),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WaitStatementWait {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WaitStatementFork {
|
||||
pub nodes: (Keyword, Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WaitStatementOrder {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -167,18 +167,18 @@ pub struct WaitStatementOrder {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EventTrigger {
|
||||
Named(EventTriggerNamed),
|
||||
Nonblocking(EventTriggerNonblocking),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventTriggerNamed {
|
||||
pub nodes: (Symbol, HierarchicalEventIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventTriggerNonblocking {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -188,24 +188,24 @@ pub struct EventTriggerNonblocking {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DisableStatement {
|
||||
Task(DisableStatementTask),
|
||||
Block(DisableStatementBlock),
|
||||
Fork(DisableStatementFork),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DisableStatementTask {
|
||||
pub nodes: (Keyword, HierarchicalTaskIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DisableStatementBlock {
|
||||
pub nodes: (Keyword, HierarchicalBlockIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DisableStatementFork {
|
||||
pub nodes: (Keyword, Keyword, Symbol),
|
||||
}
|
||||
|
@ -8,13 +8,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConcurrentAssertionItem {
|
||||
Statement(ConcurrentAssertionItemStatement),
|
||||
CheckerInstantiation(CheckerInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConcurrentAssertionItemStatement {
|
||||
pub nodes: (
|
||||
Option<(BlockIdentifier, Symbol)>,
|
||||
@ -22,7 +22,7 @@ pub struct ConcurrentAssertionItemStatement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConcurrentAssertionStatement {
|
||||
AssertPropertyStatement(AssertPropertyStatement),
|
||||
AssumePropertyStatement(AssumePropertyStatement),
|
||||
@ -31,27 +31,27 @@ pub enum ConcurrentAssertionStatement {
|
||||
RestrictPropertyStatement(RestrictPropertyStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssertPropertyStatement {
|
||||
pub nodes: (Keyword, Keyword, Paren<PropertySpec>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssumePropertyStatement {
|
||||
pub nodes: (Keyword, Keyword, Paren<PropertySpec>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverPropertyStatement {
|
||||
pub nodes: (Keyword, Keyword, Paren<PropertySpec>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExpectPropertyStatement {
|
||||
pub nodes: (Keyword, Paren<PropertySpec>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverSequenceStatement {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -65,12 +65,12 @@ pub struct CoverSequenceStatement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RestrictPropertyStatement {
|
||||
pub nodes: (Keyword, Keyword, Paren<PropertySpec>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyInstance {
|
||||
pub nodes: (
|
||||
PsOrHierarchicalPropertyIdentifier,
|
||||
@ -78,13 +78,13 @@ pub struct PropertyInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyListOfArguments {
|
||||
Ordered(PropertyListOfArgumentsOrdered),
|
||||
Named(PropertyListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol, Option<PropertyActualArg>>,
|
||||
@ -92,25 +92,25 @@ pub struct PropertyListOfArgumentsOrdered {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyListOfArgumentsNamed {
|
||||
pub nodes: (List<Symbol, (Symbol, Identifier, Paren<Option<PropertyActualArg>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyActualArg {
|
||||
PropertyExpr(PropertyExpr),
|
||||
SequenceActualArg(SequenceActualArg),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssertionItemDeclaration {
|
||||
PropertyDeclaration(PropertyDeclaration),
|
||||
SequenceDeclaration(SequenceDeclaration),
|
||||
LetDeclaration(LetDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -125,12 +125,12 @@ pub struct PropertyDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyPortList {
|
||||
pub nodes: (List<Symbol, PropertyPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -142,18 +142,18 @@ pub struct PropertyPortItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyLvarPortDirection {
|
||||
Input(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyFormalType {
|
||||
SequenceFormalType(SequenceFormalType),
|
||||
Property(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertySpec {
|
||||
pub nodes: (
|
||||
Option<ClockingEvent>,
|
||||
@ -162,7 +162,7 @@ pub struct PropertySpec {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyExpr {
|
||||
SequenceExpr(SequenceExpr),
|
||||
Strong(PropertyExprStrong),
|
||||
@ -197,47 +197,47 @@ pub enum PropertyExpr {
|
||||
ClockingEvent(Box<PropertyExprClockingEvent>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprStrong {
|
||||
pub nodes: (Keyword, Paren<SequenceExpr>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprWeak {
|
||||
pub nodes: (Keyword, Paren<SequenceExpr>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprParen {
|
||||
pub nodes: (Paren<SequenceExpr>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprNot {
|
||||
pub nodes: (Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprOr {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprAnd {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprImplicationOverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprImplicationNonoverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprIf {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -247,7 +247,7 @@ pub struct PropertyExprIf {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprCase {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -258,27 +258,27 @@ pub struct PropertyExprCase {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprFollowedByOverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprFollowedByNonoverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprNexttime {
|
||||
pub nodes: (Keyword, Option<Bracket<ConstantExpression>>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSNexttime {
|
||||
pub nodes: (Keyword, Option<Bracket<ConstantExpression>>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprAlways {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -287,7 +287,7 @@ pub struct PropertyExprAlways {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSAlways {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -296,12 +296,12 @@ pub struct PropertyExprSAlways {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprEventually {
|
||||
pub nodes: (Keyword, Bracket<ConstantRange>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSEventually {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -310,78 +310,78 @@ pub struct PropertyExprSEventually {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprUntil {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSUntil {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprUntilWith {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSUntilWith {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprImplies {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprIff {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprAcceptOn {
|
||||
pub nodes: (Keyword, Paren<ExpressionOrDist>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprRejectOn {
|
||||
pub nodes: (Keyword, Paren<ExpressionOrDist>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSyncAcceptOn {
|
||||
pub nodes: (Keyword, Paren<ExpressionOrDist>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprSyncRejectOn {
|
||||
pub nodes: (Keyword, Paren<ExpressionOrDist>, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprClockingEvent {
|
||||
pub nodes: (ClockingEvent, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyCaseItem {
|
||||
Nondefault(PropertyCaseItemNondefault),
|
||||
Default(PropertyCaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyCaseItemNondefault {
|
||||
pub nodes: (List<Symbol, ExpressionOrDist>, Symbol, PropertyExpr, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyCaseItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, PropertyExpr, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -396,12 +396,12 @@ pub struct SequenceDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequencePortList {
|
||||
pub nodes: (List<Symbol, SequencePortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequencePortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -413,21 +413,21 @@ pub struct SequencePortItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceLvarPortDirection {
|
||||
Input(Keyword),
|
||||
Inout(Keyword),
|
||||
Output(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceFormalType {
|
||||
DataTypeOrImplicit(DataTypeOrImplicit),
|
||||
Sequence(Keyword),
|
||||
Untyped(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceExpr {
|
||||
CycleDelayExpr(Box<SequenceExprCycleDelayExpr>),
|
||||
ExprCycleDelayExpr(Box<SequenceExprExprCycleDelayExpr>),
|
||||
@ -443,7 +443,7 @@ pub enum SequenceExpr {
|
||||
ClockingEvent(Box<SequenceExprClockingEvent>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprCycleDelayExpr {
|
||||
pub nodes: (
|
||||
CycleDelayRange,
|
||||
@ -452,7 +452,7 @@ pub struct SequenceExprCycleDelayExpr {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprExprCycleDelayExpr {
|
||||
pub nodes: (
|
||||
SequenceExpr,
|
||||
@ -462,17 +462,17 @@ pub struct SequenceExprExprCycleDelayExpr {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprExpression {
|
||||
pub nodes: (ExpressionOrDist, Option<BooleanAbbrev>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprInstance {
|
||||
pub nodes: (SequenceInstance, Option<SequenceAbbrev>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprParen {
|
||||
pub nodes: (
|
||||
Paren<(SequenceExpr, Vec<(Symbol, SequenceMatchItem)>)>,
|
||||
@ -480,22 +480,22 @@ pub struct SequenceExprParen {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprAnd {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprIntersect {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprOr {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprFirstMatch {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -503,22 +503,22 @@ pub struct SequenceExprFirstMatch {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprThroughout {
|
||||
pub nodes: (ExpressionOrDist, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprWithin {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprClockingEvent {
|
||||
pub nodes: (ClockingEvent, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CycleDelayRange {
|
||||
Primary(CycleDelayRangePrimary),
|
||||
Expression(CycleDelayRangeExpression),
|
||||
@ -526,39 +526,39 @@ pub enum CycleDelayRange {
|
||||
Plus(CycleDelayRangePlus),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayRangePrimary {
|
||||
pub nodes: (Symbol, ConstantPrimary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayRangeExpression {
|
||||
pub nodes: (Symbol, Bracket<CycleDelayConstRangeExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayRangeAsterisk {
|
||||
pub nodes: (Symbol, Bracket<Symbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayRangePlus {
|
||||
pub nodes: (Symbol, Bracket<Symbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceMethodCall {
|
||||
pub nodes: (SequenceInstance, Symbol, MethodIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceMatchItem {
|
||||
OperatorAssignment(OperatorAssignment),
|
||||
IncOrDecExpression(IncOrDecExpression),
|
||||
SubroutineCall(SubroutineCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceInstance {
|
||||
pub nodes: (
|
||||
PsOrHierarchicalSequenceIdentifier,
|
||||
@ -566,13 +566,13 @@ pub struct SequenceInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceListOfArguments {
|
||||
Ordered(SequenceListOfArgumentsOrdered),
|
||||
Named(SequenceListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol, Option<SequenceActualArg>>,
|
||||
@ -580,89 +580,89 @@ pub struct SequenceListOfArgumentsOrdered {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceListOfArgumentsNamed {
|
||||
pub nodes: (List<Symbol, (Symbol, Identifier, Paren<Option<SequenceActualArg>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SequenceActualArg {
|
||||
EventExpression(EventExpression),
|
||||
SequenceExpr(SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BooleanAbbrev {
|
||||
ConsecutiveRepetition(ConsecutiveRepetition),
|
||||
NonConsecutiveRepetition(NonConsecutiveRepetition),
|
||||
GotoRepetition(GotoRepetition),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceAbbrev {
|
||||
pub nodes: (ConsecutiveRepetition,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConsecutiveRepetition {
|
||||
Expression(ConsecutiveRepetitionExpression),
|
||||
Asterisk(ConsecutiveRepetitionAsterisk),
|
||||
Plus(ConsecutiveRepetitionPlus),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConsecutiveRepetitionExpression {
|
||||
pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConsecutiveRepetitionAsterisk {
|
||||
pub nodes: (Bracket<Symbol>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConsecutiveRepetitionPlus {
|
||||
pub nodes: (Bracket<Symbol>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonConsecutiveRepetition {
|
||||
pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GotoRepetition {
|
||||
pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstOrRangeExpression {
|
||||
ConstantExpression(ConstantExpression),
|
||||
CycleDelayConstRangeExpression(CycleDelayConstRangeExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CycleDelayConstRangeExpression {
|
||||
Binary(CycleDelayConstRangeExpressionBinary),
|
||||
Dollar(CycleDelayConstRangeExpressionDollar),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayConstRangeExpressionBinary {
|
||||
pub nodes: (ConstantExpression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CycleDelayConstRangeExpressionDollar {
|
||||
pub nodes: (ConstantExpression, Symbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExpressionOrDist {
|
||||
pub nodes: (Expression, Option<(Keyword, Brace<DistList>)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssertionVariableDeclaration {
|
||||
pub nodes: (VarDataType, ListOfVariableDeclAssignments, Symbol),
|
||||
}
|
||||
@ -1601,7 +1601,7 @@ pub fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
|
||||
let (s, a) = sequence_instance(s)?;
|
||||
let (s, b) = symbol(".")(s)?;
|
||||
|
@ -6,7 +6,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BlockItemDeclaration {
|
||||
Data(BlockItemDeclarationData),
|
||||
LocalParameter(BlockItemDeclarationLocalParameter),
|
||||
@ -14,12 +14,12 @@ pub enum BlockItemDeclaration {
|
||||
Let(BlockItemDeclarationLet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockItemDeclarationData {
|
||||
pub nodes: (Vec<AttributeInstance>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockItemDeclarationLocalParameter {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -28,7 +28,7 @@ pub struct BlockItemDeclarationLocalParameter {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockItemDeclarationParameter {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -37,7 +37,7 @@ pub struct BlockItemDeclarationParameter {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockItemDeclarationLet {
|
||||
pub nodes: (Vec<AttributeInstance>, LetDeclaration),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -22,34 +22,34 @@ pub struct CovergroupDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CoverageSpecOrOption {
|
||||
Spec(CoverageSpecOrOptionSpec),
|
||||
Option(CoverageSpecOrOptionOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageSpecOrOptionSpec {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageSpec),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageSpecOrOptionOption {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageOption, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CoverageOption {
|
||||
Option(CoverageOptionOption),
|
||||
TypeOption(CoverageOptionTypeOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageOptionOption {
|
||||
pub nodes: (Keyword, Symbol, MemberIdentifier, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageOptionTypeOption {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -60,70 +60,70 @@ pub struct CoverageOptionTypeOption {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CoverageSpec {
|
||||
CoverPoint(CoverPoint),
|
||||
CoverCross(CoverCross),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CoverageEvent {
|
||||
ClockingEvent(ClockingEvent),
|
||||
Sample(CoverageEventSample),
|
||||
At(CoverageEventAt),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageEventSample {
|
||||
pub nodes: (Keyword, Keyword, Keyword, Paren<Option<TfPortList>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverageEventAt {
|
||||
pub nodes: (Symbol, Paren<BlockEventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BlockEventExpression {
|
||||
Or(Box<BlockEventExpressionOr>),
|
||||
Begin(BlockEventExpressionBegin),
|
||||
End(BlockEventExpressionEnd),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockEventExpressionOr {
|
||||
pub nodes: (BlockEventExpression, Keyword, BlockEventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockEventExpressionBegin {
|
||||
pub nodes: (Keyword, HierarchicalBtfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockEventExpressionEnd {
|
||||
pub nodes: (Keyword, HierarchicalBtfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum HierarchicalBtfIdentifier {
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier),
|
||||
HierarchicalBlockIdentifier(HierarchicalBlockIdentifier),
|
||||
Method(HierarchicalBtfIdentifierMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalBtfIdentifierMethod {
|
||||
pub nodes: (Option<HierarchicalIdentifierOrClassScope>, MethodIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum HierarchicalIdentifierOrClassScope {
|
||||
HierarchicalIdentifier((HierarchicalIdentifier, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverPoint {
|
||||
pub nodes: (
|
||||
Option<(Option<DataTypeOrImplicit>, CoverPointIdentifier, Symbol)>,
|
||||
@ -134,18 +134,18 @@ pub struct CoverPoint {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BinsOrEmpty {
|
||||
NonEmpty(BinsOrEmptyNonEmpty),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrEmptyNonEmpty {
|
||||
pub nodes: (Brace<(Vec<AttributeInstance>, Vec<(BinsOrOptions, Symbol)>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BinsOrOptions {
|
||||
CoverageOption(CoverageOption),
|
||||
Covergroup(BinsOrOptionsCovergroup),
|
||||
@ -156,7 +156,7 @@ pub enum BinsOrOptions {
|
||||
DefaultSequence(BinsOrOptionsDefaultSequence),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsCovergroup {
|
||||
pub nodes: (
|
||||
Option<Wildcard>,
|
||||
@ -170,12 +170,12 @@ pub struct BinsOrOptionsCovergroup {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Wildcard {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsCoverPoint {
|
||||
pub nodes: (
|
||||
Option<Wildcard>,
|
||||
@ -190,7 +190,7 @@ pub struct BinsOrOptionsCoverPoint {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsSetCovergroup {
|
||||
pub nodes: (
|
||||
Option<Wildcard>,
|
||||
@ -203,7 +203,7 @@ pub struct BinsOrOptionsSetCovergroup {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsTransList {
|
||||
pub nodes: (
|
||||
Option<Wildcard>,
|
||||
@ -216,7 +216,7 @@ pub struct BinsOrOptionsTransList {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsDefault {
|
||||
pub nodes: (
|
||||
BinsKeyword,
|
||||
@ -228,7 +228,7 @@ pub struct BinsOrOptionsDefault {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsOrOptionsDefaultSequence {
|
||||
pub nodes: (
|
||||
BinsKeyword,
|
||||
@ -240,24 +240,24 @@ pub struct BinsOrOptionsDefaultSequence {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BinsKeyword {
|
||||
Bins(Keyword),
|
||||
IllegalBins(Keyword),
|
||||
IgnoreBins(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransList {
|
||||
pub nodes: (List<Symbol, Paren<TransSet>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransSet {
|
||||
pub nodes: (List<Symbol, TransRangeList>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TransRangeList {
|
||||
TransItem(TransItem),
|
||||
Asterisk(TransRangeListAsterisk),
|
||||
@ -265,38 +265,38 @@ pub enum TransRangeList {
|
||||
Equal(TransRangeListEqual),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransRangeListAsterisk {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransRangeListArrow {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransRangeListEqual {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TransItem {
|
||||
pub nodes: (CovergroupRangeList,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RepeatRange {
|
||||
CovergroupExpression(CovergroupExpression),
|
||||
Binary(RepeatRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RepeatRangeBinary {
|
||||
pub nodes: (CovergroupExpression, Symbol, CovergroupExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverCross {
|
||||
pub nodes: (
|
||||
Option<(CrossIdentifier, Symbol)>,
|
||||
@ -307,51 +307,51 @@ pub struct CoverCross {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfCrossItems {
|
||||
pub nodes: (CrossItem, List<Symbol, CrossItem>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CrossItem {
|
||||
CoverPointIdentifier(CoverPointIdentifier),
|
||||
VariableIdentifier(VariableIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CrossBody {
|
||||
NonEmpty(CrossBodyNonEmpty),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CrossBodyNonEmpty {
|
||||
pub nodes: (Brace<Vec<(CrossBodyItem, Symbol)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CrossBodyItem {
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
BinsSelectionOrOption((BinsSelectionOrOption, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BinsSelectionOrOption {
|
||||
Coverage(BinsSelectionOrOptionCoverage),
|
||||
Bins(BinsSelectionOrOptionBins),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionCoverage {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionBins {
|
||||
pub nodes: (Vec<AttributeInstance>, BinsSelection),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsSelection {
|
||||
pub nodes: (
|
||||
BinsKeyword,
|
||||
@ -362,7 +362,7 @@ pub struct BinsSelection {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SelectExpression {
|
||||
SelectCondition(SelectCondition),
|
||||
Not(SelectExpressionNot),
|
||||
@ -374,27 +374,27 @@ pub enum SelectExpression {
|
||||
CrossSet(SelectExpressionCrossSet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionNot {
|
||||
pub nodes: (Symbol, SelectCondition),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionAnd {
|
||||
pub nodes: (SelectExpression, Symbol, SelectExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionOr {
|
||||
pub nodes: (SelectExpression, Symbol, SelectExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionParen {
|
||||
pub nodes: (Paren<SelectExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionWith {
|
||||
pub nodes: (
|
||||
SelectExpression,
|
||||
@ -404,7 +404,7 @@ pub struct SelectExpressionWith {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectExpressionCrossSet {
|
||||
pub nodes: (
|
||||
CrossSetExpression,
|
||||
@ -412,7 +412,7 @@ pub struct SelectExpressionCrossSet {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SelectCondition {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -421,54 +421,54 @@ pub struct SelectCondition {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BinsExpression {
|
||||
VariableIdentifier(VariableIdentifier),
|
||||
CoverPoint(BinsExpressionCoverPoint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinsExpressionCoverPoint {
|
||||
pub nodes: (CoverPointIdentifier, Option<(Symbol, BinIdentifier)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupRangeList {
|
||||
pub nodes: (List<Symbol, CovergroupValueRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CovergroupValueRange {
|
||||
CovergroupExpression(CovergroupExpression),
|
||||
Binary(CovergroupValueRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupValueRangeBinary {
|
||||
pub nodes: (Bracket<(CovergroupExpression, Symbol, CovergroupExpression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WithCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SetCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IntegerCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CrossSetExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DefparamAssignment {
|
||||
pub nodes: (
|
||||
HierarchicalParameterIdentifier,
|
||||
@ -17,7 +17,7 @@ pub struct DefparamAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetDeclAssignment {
|
||||
pub nodes: (
|
||||
NetIdentifier,
|
||||
@ -26,7 +26,7 @@ pub struct NetDeclAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParamAssignment {
|
||||
pub nodes: (
|
||||
ParameterIdentifier,
|
||||
@ -35,29 +35,29 @@ pub struct ParamAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SpecparamAssignment {
|
||||
Mintypmax(SpecparamAssignmentMintypmax),
|
||||
PulseControlSpecparam(PulseControlSpecparam),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecparamAssignmentMintypmax {
|
||||
pub nodes: (SpecparamIdentifier, Symbol, ConstantMintypmaxExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeAssignment {
|
||||
pub nodes: (TypeIdentifier, Option<(Symbol, DataType)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PulseControlSpecparam {
|
||||
WithoutDescriptor(PulseControlSpecparamWithoutDescriptor),
|
||||
WithDescriptor(PulseControlSpecparamWithDescriptor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulseControlSpecparamWithoutDescriptor {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -66,7 +66,7 @@ pub struct PulseControlSpecparamWithoutDescriptor {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulseControlSpecparamWithDescriptor {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -78,29 +78,29 @@ pub struct PulseControlSpecparamWithDescriptor {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ErrorLimitValue {
|
||||
pub nodes: (LimitValue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RejectLimitValue {
|
||||
pub nodes: (LimitValue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LimitValue {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VariableDeclAssignment {
|
||||
Variable(VariableDeclAssignmentVariable),
|
||||
DynamicArray(VariableDeclAssignmentDynamicArray),
|
||||
Class(VariableDeclAssignmentClass),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableDeclAssignmentVariable {
|
||||
pub nodes: (
|
||||
VariableIdentifier,
|
||||
@ -109,7 +109,7 @@ pub struct VariableDeclAssignmentVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableDeclAssignmentDynamicArray {
|
||||
pub nodes: (
|
||||
DynamicArrayVariableIdentifier,
|
||||
@ -119,28 +119,28 @@ pub struct VariableDeclAssignmentDynamicArray {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableDeclAssignmentClass {
|
||||
pub nodes: (ClassVariableIdentifier, Option<(Symbol, ClassNew)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassNew {
|
||||
Argument(ClassNewArgument),
|
||||
Expression(ClassNewExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassNewArgument {
|
||||
pub nodes: (Option<ClassScope>, Keyword, Option<Paren<ListOfArguments>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassNewExpression {
|
||||
pub nodes: (Keyword, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DynamicArrayNew {
|
||||
pub nodes: (Keyword, Bracket<Expression>, Option<Paren<Expression>>),
|
||||
}
|
||||
|
@ -7,47 +7,47 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfDefparamAssignments {
|
||||
pub nodes: (List<Symbol, DefparamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfGenvarIdentifiers {
|
||||
pub nodes: (List<Symbol, GenvarIdentifier>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfInterfaceIdentifiers {
|
||||
pub nodes: (List<Symbol, (InterfaceIdentifier, Vec<UnpackedDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfNetDeclAssignments {
|
||||
pub nodes: (List<Symbol, NetDeclAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfParamAssignments {
|
||||
pub nodes: (List<Symbol, ParamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPortIdentifiers {
|
||||
pub nodes: (List<Symbol, (PortIdentifier, Vec<UnpackedDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfUdpPortIdentifiers {
|
||||
pub nodes: (List<Symbol, PortIdentifier>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfSpecparamAssignments {
|
||||
pub nodes: (List<Symbol, SpecparamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfTfVariableIdentifiers {
|
||||
pub nodes: (
|
||||
List<
|
||||
@ -61,22 +61,22 @@ pub struct ListOfTfVariableIdentifiers {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfTypeAssignments {
|
||||
pub nodes: (List<Symbol, TypeAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfVariableDeclAssignments {
|
||||
pub nodes: (List<Symbol, VariableDeclAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfVariableIdentifiers {
|
||||
pub nodes: (List<Symbol, (VariableIdentifier, Vec<VariableDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfVariablePortIdentifiers {
|
||||
pub nodes: (
|
||||
List<
|
||||
|
@ -7,50 +7,50 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UnpackedDimension {
|
||||
Range(UnpackedDimensionRange),
|
||||
Expression(UnpackedDimensionExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnpackedDimensionRange {
|
||||
pub nodes: (Bracket<ConstantRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnpackedDimensionExpression {
|
||||
pub nodes: (Bracket<ConstantExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackedDimension {
|
||||
Range(PackedDimensionRange),
|
||||
UnsizedDimension(UnsizedDimension),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackedDimensionRange {
|
||||
pub nodes: (Bracket<ConstantRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AssociativeDimension {
|
||||
DataType(AssociativeDimensionDataType),
|
||||
Asterisk(AssociativeDimensionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssociativeDimensionDataType {
|
||||
pub nodes: (Bracket<DataType>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AssociativeDimensionAsterisk {
|
||||
pub nodes: (Bracket<Symbol>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VariableDimension {
|
||||
UnsizedDimension(UnsizedDimension),
|
||||
UnpackedDimension(UnpackedDimension),
|
||||
@ -58,12 +58,12 @@ pub enum VariableDimension {
|
||||
QueueDimension(QueueDimension),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct QueueDimension {
|
||||
pub nodes: (Bracket<(Symbol, Option<(Symbol, ConstantExpression)>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnsizedDimension {
|
||||
pub nodes: (Symbol, Symbol),
|
||||
}
|
||||
|
@ -7,18 +7,18 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Delay3 {
|
||||
Single(Delay3Single),
|
||||
Mintypmax(Delay3Mintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Delay3Single {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Delay3Mintypmax {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -33,18 +33,18 @@ pub struct Delay3Mintypmax {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Delay2 {
|
||||
Single(Delay2Single),
|
||||
Mintypmax(Delay2Mintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Delay2Single {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Delay2Mintypmax {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -52,7 +52,7 @@ pub struct Delay2Mintypmax {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DelayValue {
|
||||
UnsignedNumber(UnsignedNumber),
|
||||
RealNumber(RealNumber),
|
||||
|
@ -8,24 +8,24 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum FunctionDataTypeOrImplicit {
|
||||
DataTypeOrVoid(DataTypeOrVoid),
|
||||
ImplicitDataType(ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionDeclaration {
|
||||
pub nodes: (Keyword, Option<Lifetime>, FunctionBodyDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum FunctionBodyDeclaration {
|
||||
WithoutPort(FunctionBodyDeclarationWithoutPort),
|
||||
WithPort(FunctionBodyDeclarationWithPort),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionBodyDeclarationWithoutPort {
|
||||
pub nodes: (
|
||||
Option<FunctionDataTypeOrImplicit>,
|
||||
@ -39,7 +39,7 @@ pub struct FunctionBodyDeclarationWithoutPort {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionBodyDeclarationWithPort {
|
||||
pub nodes: (
|
||||
Option<FunctionDataTypeOrImplicit>,
|
||||
@ -54,13 +54,13 @@ pub struct FunctionBodyDeclarationWithPort {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfaceIdentifierOrClassScope {
|
||||
InterfaceIdentifier((InterfaceIdentifier, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionPrototype {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -70,7 +70,7 @@ pub struct FunctionPrototype {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DpiImportExport {
|
||||
ImportFunction(DpiImportExportImportFunction),
|
||||
ImportTask(DpiImportExportImportTask),
|
||||
@ -78,7 +78,7 @@ pub enum DpiImportExport {
|
||||
ExportTask(DpiImportExportExportTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiImportExportImportFunction {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -90,7 +90,7 @@ pub struct DpiImportExportImportFunction {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiImportExportImportTask {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -102,7 +102,7 @@ pub struct DpiImportExportImportTask {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiImportExportExportFunction {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -114,7 +114,7 @@ pub struct DpiImportExportExportFunction {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiImportExportExportTask {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -126,29 +126,29 @@ pub struct DpiImportExportExportTask {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DpiSpecString {
|
||||
DpiC(Keyword),
|
||||
Dpi(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DpiFunctionImportProperty {
|
||||
Context(Keyword),
|
||||
Pure(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DpiTaskImportProperty {
|
||||
Context(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiFunctionProto {
|
||||
pub nodes: (FunctionPrototype,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DpiTaskProto {
|
||||
pub nodes: (TaskPrototype,),
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportDeclaration {
|
||||
pub nodes: (Keyword, List<Symbol, ModportItem>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportItem {
|
||||
pub nodes: (
|
||||
ModportIdentifier,
|
||||
@ -20,66 +20,66 @@ pub struct ModportItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModportPortsDeclaraton {
|
||||
Simple(ModportPortsDeclaratonSimple),
|
||||
Tf(ModportPortsDeclaratonTf),
|
||||
Clocking(ModportPortsDeclaratonClocking),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonSimple {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportSimplePortsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonTf {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportTfPortsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonClocking {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportClockingDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportClockingDeclaration {
|
||||
pub nodes: (Keyword, ClockingIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportSimplePortsDeclaration {
|
||||
pub nodes: (PortDirection, List<Symbol, ModportSimplePort>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModportSimplePort {
|
||||
Ordered(ModportSimplePortOrdered),
|
||||
Named(ModportSimplePortNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportSimplePortOrdered {
|
||||
pub nodes: (PortIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportSimplePortNamed {
|
||||
pub nodes: (Symbol, PortIdentifier, Paren<Option<Expression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportTfPortsDeclaration {
|
||||
pub nodes: (ImportExport, List<Symbol, ModportTfPort>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModportTfPort {
|
||||
MethodPrototype(MethodPrototype),
|
||||
TfIdentifier(TfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImportExport {
|
||||
Import(Keyword),
|
||||
Export(Keyword),
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -20,17 +20,17 @@ pub struct LetDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetPortList {
|
||||
pub nodes: (List<Symbol, LetPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -41,13 +41,13 @@ pub struct LetPortItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LetFormalType {
|
||||
DataTypeOrImplicit(DataTypeOrImplicit),
|
||||
Untyped(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetExpression {
|
||||
pub nodes: (
|
||||
Option<PackageScope>,
|
||||
@ -56,13 +56,13 @@ pub struct LetExpression {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LetListOfArguments {
|
||||
Ordered(LetListOfArgumentsOrdered),
|
||||
Named(LetListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol, Option<LetActualArg>>,
|
||||
@ -70,12 +70,12 @@ pub struct LetListOfArgumentsOrdered {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetListOfArgumentsNamed {
|
||||
pub nodes: (List<Symbol, (Symbol, Identifier, Paren<Option<LetActualArg>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LetActualArg {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
@ -135,7 +135,7 @@ pub fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn let_expression(s: Span) -> IResult<Span, LetExpression> {
|
||||
let (s, a) = opt(package_scope)(s)?;
|
||||
let (s, b) = let_identifier(s)?;
|
||||
|
@ -6,13 +6,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LocalParameterDeclaration {
|
||||
Param(LocalParameterDeclarationParam),
|
||||
Type(LocalParameterDeclarationType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LocalParameterDeclarationParam {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -21,18 +21,18 @@ pub struct LocalParameterDeclarationParam {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LocalParameterDeclarationType {
|
||||
pub nodes: (Keyword, Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ParameterDeclaration {
|
||||
Param(ParameterDeclarationParam),
|
||||
Type(ParameterDeclarationType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterDeclarationParam {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -41,12 +41,12 @@ pub struct ParameterDeclarationParam {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterDeclarationType {
|
||||
pub nodes: (Keyword, Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecparamDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CastingType {
|
||||
SimpleType(Box<SimpleType>),
|
||||
ConstantPrimary(Box<ConstantPrimary>),
|
||||
@ -17,7 +17,7 @@ pub enum CastingType {
|
||||
Const(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DataType {
|
||||
Vector(DataTypeVector),
|
||||
Atom(DataTypeAtom),
|
||||
@ -34,17 +34,17 @@ pub enum DataType {
|
||||
TypeReference(Box<TypeReference>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeVector {
|
||||
pub nodes: (IntegerVectorType, Option<Signing>, Vec<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeAtom {
|
||||
pub nodes: (IntegerAtomType, Option<Signing>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeStructUnion {
|
||||
pub nodes: (
|
||||
StructUnion,
|
||||
@ -54,12 +54,12 @@ pub struct DataTypeStructUnion {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Packed {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeEnum {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -69,7 +69,7 @@ pub struct DataTypeEnum {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeVirtual {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -80,12 +80,12 @@ pub struct DataTypeVirtual {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Interface {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataTypeType {
|
||||
pub nodes: (
|
||||
Option<PackageScopeOrClassScope>,
|
||||
@ -94,40 +94,40 @@ pub struct DataTypeType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DataTypeOrImplicit {
|
||||
DataType(DataType),
|
||||
ImplicitDataType(ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ImplicitDataType {
|
||||
pub nodes: (Option<Signing>, Vec<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EnumBaseType {
|
||||
Atom(EnumBaseTypeAtom),
|
||||
Vector(EnumBaseTypeVector),
|
||||
Type(EnumBaseTypeType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnumBaseTypeAtom {
|
||||
pub nodes: (IntegerAtomType, Option<Signing>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnumBaseTypeVector {
|
||||
pub nodes: (IntegerVectorType, Option<Signing>, Option<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnumBaseTypeType {
|
||||
pub nodes: (TypeIdentifier, Option<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnumNameDeclaration {
|
||||
pub nodes: (
|
||||
EnumIdentifier,
|
||||
@ -136,12 +136,12 @@ pub struct EnumNameDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassScope {
|
||||
pub nodes: (ClassType, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassType {
|
||||
pub nodes: (
|
||||
PsClassIdentifier,
|
||||
@ -150,13 +150,13 @@ pub struct ClassType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum IntegerType {
|
||||
IntegerVectorType(IntegerVectorType),
|
||||
IntegerAtomType(IntegerAtomType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum IntegerAtomType {
|
||||
Byte(Keyword),
|
||||
Shortint(Keyword),
|
||||
@ -166,21 +166,21 @@ pub enum IntegerAtomType {
|
||||
Time(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum IntegerVectorType {
|
||||
Bit(Keyword),
|
||||
Logic(Keyword),
|
||||
Reg(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NonIntegerType {
|
||||
Shortreal(Keyword),
|
||||
Real(Keyword),
|
||||
Realtime(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetType {
|
||||
Supply0(Keyword),
|
||||
Supply1(Keyword),
|
||||
@ -196,46 +196,46 @@ pub enum NetType {
|
||||
Wor(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetPortType {
|
||||
DataType(NetPortTypeDataType),
|
||||
NetTypeIdentifier(NetTypeIdentifier),
|
||||
Interconnect(NetPortTypeInterconnect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetPortTypeDataType {
|
||||
pub nodes: (Option<NetType>, DataTypeOrImplicit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetPortTypeInterconnect {
|
||||
pub nodes: (Keyword, ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariablePortType {
|
||||
pub nodes: (VarDataType,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VarDataType {
|
||||
DataType(DataType),
|
||||
Var(VarDataTypeVar),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VarDataTypeVar {
|
||||
pub nodes: (Keyword, DataTypeOrImplicit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Signing {
|
||||
Signed(Keyword),
|
||||
Unsigned(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SimpleType {
|
||||
IntegerType(IntegerType),
|
||||
NonIntegerType(NonIntegerType),
|
||||
@ -243,7 +243,7 @@ pub enum SimpleType {
|
||||
PsParameterIdentifier(PsParameterIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StructUnionMember {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -254,31 +254,31 @@ pub struct StructUnionMember {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DataTypeOrVoid {
|
||||
DataType(DataType),
|
||||
Void(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum StructUnion {
|
||||
Struct(Keyword),
|
||||
Union(Keyword),
|
||||
UnionTagged((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TypeReference {
|
||||
Expression(TypeReferenceExpression),
|
||||
DataType(TypeReferenceDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeReferenceExpression {
|
||||
pub nodes: (Keyword, Paren<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeReferenceDataType {
|
||||
pub nodes: (Keyword, Paren<DataType>),
|
||||
}
|
||||
@ -638,7 +638,7 @@ pub fn struct_union(s: Span) -> IResult<Span, StructUnion> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn type_reference(s: Span) -> IResult<Span, TypeReference> {
|
||||
alt((type_reference_expression, type_reference_data_type))(s)
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InoutDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -16,13 +16,13 @@ pub struct InoutDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InputDeclaration {
|
||||
Net(InputDeclarationNet),
|
||||
Variable(InputDeclarationVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InputDeclarationNet {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -31,7 +31,7 @@ pub struct InputDeclarationNet {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InputDeclarationVariable {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -40,13 +40,13 @@ pub struct InputDeclarationVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum OutputDeclaration {
|
||||
Net(OutputDeclarationNet),
|
||||
Variable(OutputDeclarationVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputDeclarationNet {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -55,7 +55,7 @@ pub struct OutputDeclarationNet {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputDeclarationVariable {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -64,7 +64,7 @@ pub struct OutputDeclarationVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfacePortDeclaration {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier,
|
||||
@ -73,7 +73,7 @@ pub struct InterfacePortDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RefDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
|
@ -6,7 +6,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DriveStrength {
|
||||
Strength01(DriveStrength01),
|
||||
Strength10(DriveStrength10),
|
||||
@ -16,37 +16,37 @@ pub enum DriveStrength {
|
||||
Strengthz1(DriveStrengthz1),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrength01 {
|
||||
pub nodes: (Paren<(Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrength10 {
|
||||
pub nodes: (Paren<(Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrength0z {
|
||||
pub nodes: (Paren<(Strength0, Symbol, Keyword)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrength1z {
|
||||
pub nodes: (Paren<(Strength1, Symbol, Keyword)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrengthz1 {
|
||||
pub nodes: (Paren<(Keyword, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DriveStrengthz0 {
|
||||
pub nodes: (Paren<(Keyword, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Strength0 {
|
||||
Supply0(Keyword),
|
||||
Strong0(Keyword),
|
||||
@ -54,7 +54,7 @@ pub enum Strength0 {
|
||||
Weak0(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Strength1 {
|
||||
Supply1(Keyword),
|
||||
Strong1(Keyword),
|
||||
@ -62,24 +62,24 @@ pub enum Strength1 {
|
||||
Weak1(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ChargeStrength {
|
||||
Small(ChargeStrengthSmall),
|
||||
Medium(ChargeStrengthMedium),
|
||||
Large(ChargeStrengthLarge),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ChargeStrengthSmall {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ChargeStrengthMedium {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ChargeStrengthLarge {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
@ -8,18 +8,18 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaskDeclaration {
|
||||
pub nodes: (Keyword, Option<Lifetime>, TaskBodyDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TaskBodyDeclaration {
|
||||
WithoutPort(TaskBodyDeclarationWithoutPort),
|
||||
WithPort(TaskBodyDeclarationWithPort),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaskBodyDeclarationWithoutPort {
|
||||
pub nodes: (
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
@ -32,7 +32,7 @@ pub struct TaskBodyDeclarationWithoutPort {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaskBodyDeclarationWithPort {
|
||||
pub nodes: (
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
@ -46,18 +46,18 @@ pub struct TaskBodyDeclarationWithPort {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TfItemDeclaration {
|
||||
BlockItemDeclaration(BlockItemDeclaration),
|
||||
TfPortDeclaration(TfPortDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TfPortList {
|
||||
pub nodes: (List<Symbol, TfPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TfPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -72,13 +72,13 @@ pub struct TfPortItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TfPortDirection {
|
||||
PortDirection(PortDirection),
|
||||
ConstRef((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TfPortDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -90,7 +90,7 @@ pub struct TfPortDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaskPrototype {
|
||||
pub nodes: (Keyword, TaskIdentifier, Option<Paren<Option<TfPortList>>>),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DataDeclaration {
|
||||
Variable(DataDeclarationVariable),
|
||||
TypeDeclaration(TypeDeclaration),
|
||||
@ -16,7 +16,7 @@ pub enum DataDeclaration {
|
||||
NetTypeDeclaration(NetTypeDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataDeclarationVariable {
|
||||
pub nodes: (
|
||||
Option<Const>,
|
||||
@ -28,12 +28,12 @@ pub struct DataDeclarationVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Const {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageImportDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -42,34 +42,34 @@ pub struct PackageImportDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageImportItem {
|
||||
Identifier(PackageImportItemIdentifier),
|
||||
Asterisk(PackageImportItemAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageImportItemIdentifier {
|
||||
pub nodes: (PackageIdentifier, Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageImportItemAsterisk {
|
||||
pub nodes: (PackageIdentifier, Symbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageExportDeclaration {
|
||||
Asterisk(PackageExportDeclarationAsterisk),
|
||||
Item(PackageExportDeclarationItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageExportDeclarationAsterisk {
|
||||
pub nodes: (Keyword, Symbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageExportDeclarationItem {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -78,19 +78,19 @@ pub struct PackageExportDeclarationItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarDeclaration {
|
||||
pub nodes: (Keyword, ListOfGenvarIdentifiers, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetDeclaration {
|
||||
NetType(NetDeclarationNetType),
|
||||
NetTypeIdentifier(NetDeclarationNetTypeIdentifier),
|
||||
Interconnect(NetDeclarationInterconnect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetDeclarationNetType {
|
||||
pub nodes: (
|
||||
NetType,
|
||||
@ -103,19 +103,19 @@ pub struct NetDeclarationNetType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Strength {
|
||||
Drive(DriveStrength),
|
||||
Charge(ChargeStrength),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VectorScalar {
|
||||
Vectored(Keyword),
|
||||
Scalared(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetDeclarationNetTypeIdentifier {
|
||||
pub nodes: (
|
||||
NetTypeIdentifier,
|
||||
@ -125,7 +125,7 @@ pub struct NetDeclarationNetTypeIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetDeclarationInterconnect {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -138,14 +138,14 @@ pub struct NetDeclarationInterconnect {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TypeDeclaration {
|
||||
DataType(TypeDeclarationDataType),
|
||||
Interface(TypeDeclarationInterface),
|
||||
Reserved(TypeDeclarationReserved),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeDeclarationDataType {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -156,7 +156,7 @@ pub struct TypeDeclarationDataType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeDeclarationInterface {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -169,7 +169,7 @@ pub struct TypeDeclarationInterface {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeDeclarationReserved {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -179,7 +179,7 @@ pub struct TypeDeclarationReserved {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TypeDeclarationKeyword {
|
||||
Enum(Keyword),
|
||||
Struct(Keyword),
|
||||
@ -188,13 +188,13 @@ pub enum TypeDeclarationKeyword {
|
||||
InterfaceClass((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetTypeDeclaration {
|
||||
DataType(NetTypeDeclarationDataType),
|
||||
NetType(NetTypeDeclarationNetType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetTypeDeclarationDataType {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -209,7 +209,7 @@ pub struct NetTypeDeclarationDataType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetTypeDeclarationNetType {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -220,7 +220,7 @@ pub struct NetTypeDeclarationNetType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Lifetime {
|
||||
Static(Keyword),
|
||||
Automatic(Keyword),
|
||||
|
@ -7,75 +7,63 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Concatenation {
|
||||
pub nodes: (Brace<List<Symbol, Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantConcatenation {
|
||||
pub nodes: (Brace<List<Symbol, ConstantExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantMultipleConcatenation {
|
||||
pub nodes: (Brace<(ConstantExpression, ConstantConcatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathConcatenation {
|
||||
pub nodes: (Brace<List<Symbol, ModulePathExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathMultipleConcatenation {
|
||||
pub nodes: (Brace<(ConstantExpression, ModulePathConcatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MultipleConcatenation {
|
||||
pub nodes: (Brace<(Expression, Concatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StreamingConcatenation {
|
||||
pub nodes: (
|
||||
Brace<
|
||||
|
||||
(
|
||||
StreamOperator,
|
||||
Option<SliceSize>,
|
||||
StreamConcatenation,
|
||||
),
|
||||
>,
|
||||
),
|
||||
pub nodes: (Brace<(StreamOperator, Option<SliceSize>, StreamConcatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StreamOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SliceSize {
|
||||
SimpleType(SimpleType),
|
||||
ConstantExpression(ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StreamConcatenation {
|
||||
pub nodes: (Brace<List<Symbol, StreamExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StreamExpression {
|
||||
pub nodes: (
|
||||
Expression,
|
||||
Option<(Keyword, Bracket< ArrayRangeExpression>)>,
|
||||
),
|
||||
pub nodes: (Expression, Option<(Keyword, Bracket<ArrayRangeExpression>)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ArrayRangeExpression {
|
||||
Expression(Expression),
|
||||
Colon(ArrayRangeExpressionColon),
|
||||
@ -83,22 +71,22 @@ pub enum ArrayRangeExpression {
|
||||
MinusColon(ArrayRangeExpressionMinusColon),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ArrayRangeExpressionColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ArrayRangeExpressionPlusColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ArrayRangeExpressionMinusColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EmptyUnpackedArrayConcatenation {
|
||||
pub nodes: (Symbol, Symbol),
|
||||
}
|
||||
@ -143,7 +131,7 @@ pub fn multiple_concatenation(s: Span) -> IResult<Span, MultipleConcatenation> {
|
||||
Ok((s, MultipleConcatenation { nodes: (a,) }))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
|
||||
let (s, a) = brace(triple(
|
||||
stream_operator,
|
||||
|
@ -6,24 +6,24 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetLvalue {
|
||||
Identifier(NetLvalueIdentifier),
|
||||
Lvalue(Box<NetLvalueLvalue>),
|
||||
Pattern(Box<NetLvaluePattern>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetLvalueIdentifier {
|
||||
pub nodes: (PsOrHierarchicalNetIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetLvalueLvalue {
|
||||
pub nodes: (Brace<List<Symbol, NetLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetLvaluePattern {
|
||||
pub nodes: (
|
||||
Option<AssignmentPatternExpressionType>,
|
||||
@ -31,7 +31,7 @@ pub struct NetLvaluePattern {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VariableLvalue {
|
||||
Identifier(VariableLvalueIdentifier),
|
||||
Lvalue(Box<VariableLvalueLvalue>),
|
||||
@ -39,7 +39,7 @@ pub enum VariableLvalue {
|
||||
StreamingConcatenation(StreamingConcatenation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableLvalueIdentifier {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrPackageScope>,
|
||||
@ -48,12 +48,12 @@ pub struct VariableLvalueIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableLvalueLvalue {
|
||||
pub nodes: (Brace<List<Symbol, VariableLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableLvaluePattern {
|
||||
pub nodes: (
|
||||
Option<AssignmentPatternExpressionType>,
|
||||
@ -61,7 +61,7 @@ pub struct VariableLvaluePattern {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonrangeVariableLvalue {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrPackageScope>,
|
||||
|
@ -4,34 +4,27 @@ use nom::branch::*;
|
||||
use nom::combinator::*;
|
||||
use nom::multi::*;
|
||||
use nom::IResult;
|
||||
use nom_packrat::packrat_parser;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum IncOrDecExpression {
|
||||
Prefix(IncOrDecExpressionPrefix),
|
||||
Suffix(IncOrDecExpressionSuffix),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IncOrDecExpressionPrefix {
|
||||
pub nodes: (
|
||||
IncOrDecOperator,
|
||||
Vec<AttributeInstance>,
|
||||
VariableLvalue,
|
||||
),
|
||||
pub nodes: (IncOrDecOperator, Vec<AttributeInstance>, VariableLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IncOrDecExpressionSuffix {
|
||||
pub nodes: (
|
||||
VariableLvalue,
|
||||
Vec<AttributeInstance>,
|
||||
IncOrDecOperator,
|
||||
),
|
||||
pub nodes: (VariableLvalue, Vec<AttributeInstance>, IncOrDecOperator),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConditionalExpression {
|
||||
pub nodes: (
|
||||
CondPredicate,
|
||||
@ -43,7 +36,7 @@ pub struct ConditionalExpression {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantExpression {
|
||||
ConstantPrimary(Box<ConstantPrimary>),
|
||||
Unary(Box<ConstantExpressionUnary>),
|
||||
@ -51,16 +44,12 @@ pub enum ConstantExpression {
|
||||
Ternary(Box<ConstantExpressionTernary>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantExpressionUnary {
|
||||
pub nodes: (
|
||||
UnaryOperator,
|
||||
Vec<AttributeInstance>,
|
||||
ConstantPrimary,
|
||||
),
|
||||
pub nodes: (UnaryOperator, Vec<AttributeInstance>, ConstantPrimary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantExpressionBinary {
|
||||
pub nodes: (
|
||||
ConstantExpression,
|
||||
@ -70,7 +59,7 @@ pub struct ConstantExpressionBinary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantExpressionTernary {
|
||||
pub nodes: (
|
||||
ConstantExpression,
|
||||
@ -82,13 +71,13 @@ pub struct ConstantExpressionTernary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantMintypmaxExpression {
|
||||
Unary(ConstantExpression),
|
||||
Ternary(ConstantMintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantMintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
ConstantExpression,
|
||||
@ -99,43 +88,43 @@ pub struct ConstantMintypmaxExpressionTernary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantParamExpression {
|
||||
ConstantMintypmaxExpression(ConstantMintypmaxExpression),
|
||||
DataType(DataType),
|
||||
Dollar(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ParamExpression {
|
||||
MintypmaxExpression(MintypmaxExpression),
|
||||
DataType(Box<DataType>),
|
||||
Dollar(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantRangeExpression {
|
||||
ConstantExpression(ConstantExpression),
|
||||
ConstantPartSelectRange(ConstantPartSelectRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantPartSelectRange {
|
||||
ConstantRange(ConstantRange),
|
||||
ConstantIndexedRange(ConstantIndexedRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantRange {
|
||||
pub nodes: (ConstantExpression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantIndexedRange {
|
||||
pub nodes: (ConstantExpression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Expression {
|
||||
Primary(Box<Primary>),
|
||||
Unary(Box<ExpressionUnary>),
|
||||
@ -147,17 +136,17 @@ pub enum Expression {
|
||||
TaggedUnionExpression(Box<TaggedUnionExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExpressionUnary {
|
||||
pub nodes: (UnaryOperator, Vec<AttributeInstance>, Primary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExpressionOperatorAssignment {
|
||||
pub nodes: (Paren<OperatorAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExpressionBinary {
|
||||
pub nodes: (
|
||||
Expression,
|
||||
@ -167,45 +156,39 @@ pub struct ExpressionBinary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaggedUnionExpression {
|
||||
pub nodes: (Keyword, MemberIdentifier, Option<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InsideExpression {
|
||||
pub nodes: (Expression, Keyword, Brace<OpenRangeList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ValueRange {
|
||||
Expression(Expression),
|
||||
Binary(ValueRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ValueRangeBinary {
|
||||
pub nodes: (Bracket<(Expression, Symbol, Expression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum MintypmaxExpression {
|
||||
Expression(Expression),
|
||||
Ternary(MintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
Expression,
|
||||
Symbol,
|
||||
Expression,
|
||||
Symbol,
|
||||
Expression,
|
||||
),
|
||||
pub nodes: (Expression, Symbol, Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathConditionalExpression {
|
||||
pub nodes: (
|
||||
ModulePathExpression,
|
||||
@ -217,7 +200,7 @@ pub struct ModulePathConditionalExpression {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModulePathExpression {
|
||||
ModulePathPrimary(Box<ModulePathPrimary>),
|
||||
Unary(Box<ModulePathExpressionUnary>),
|
||||
@ -225,7 +208,7 @@ pub enum ModulePathExpression {
|
||||
ModulePathConditionalExpression(Box<ModulePathConditionalExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathExpressionUnary {
|
||||
pub nodes: (
|
||||
UnaryModulePathOperator,
|
||||
@ -234,7 +217,7 @@ pub struct ModulePathExpressionUnary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathExpressionBinary {
|
||||
pub nodes: (
|
||||
ModulePathExpression,
|
||||
@ -244,13 +227,13 @@ pub struct ModulePathExpressionBinary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModulePathMintypmaxExpression {
|
||||
ModulePathExpression(ModulePathExpression),
|
||||
Ternary(ModulePathMintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathMintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
ModulePathExpression,
|
||||
@ -261,25 +244,25 @@ pub struct ModulePathMintypmaxExpressionTernary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PartSelectRange {
|
||||
ConstantRange(ConstantRange),
|
||||
IndexedRange(IndexedRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IndexedRange {
|
||||
pub nodes: (Expression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarExpression {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn inc_or_dec_expression(s: Span) -> IResult<Span, IncOrDecExpression> {
|
||||
alt((inc_or_dec_expression_prefix, inc_or_dec_expression_suffix))(s)
|
||||
}
|
||||
@ -306,7 +289,7 @@ pub fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
|
||||
let (s, a) = cond_predicate(s)?;
|
||||
let (s, b) = symbol("?")(s)?;
|
||||
@ -322,7 +305,8 @@ pub fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
alt((
|
||||
constant_expression_unary,
|
||||
@ -334,7 +318,7 @@ pub fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
let (s, a) = unary_operator(s)?;
|
||||
let (s, b) = many0(attribute_instance)(s)?;
|
||||
@ -345,7 +329,7 @@ pub fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
let (s, a) = constant_expression(s)?;
|
||||
let (s, b) = binary_operator(s)?;
|
||||
@ -359,7 +343,7 @@ pub fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression>
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||
let (s, a) = constant_expression(s)?;
|
||||
let (s, b) = symbol("?")(s)?;
|
||||
@ -464,7 +448,8 @@ pub fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
|
||||
Ok((s, ConstantIndexedRange { nodes: (a, b, c) }))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn expression(s: Span) -> IResult<Span, Expression> {
|
||||
alt((
|
||||
expression_unary,
|
||||
@ -486,7 +471,7 @@ pub fn expression(s: Span) -> IResult<Span, Expression> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn expression_unary(s: Span) -> IResult<Span, Expression> {
|
||||
let (s, x) = unary_operator(s)?;
|
||||
let (s, y) = many0(attribute_instance)(s)?;
|
||||
@ -497,7 +482,7 @@ pub fn expression_unary(s: Span) -> IResult<Span, Expression> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
|
||||
let (s, a) = paren(operator_assignment)(s)?;
|
||||
Ok((
|
||||
@ -506,7 +491,7 @@ pub fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn expression_binary(s: Span) -> IResult<Span, Expression> {
|
||||
let (s, a) = expression(s)?;
|
||||
let (s, b) = binary_operator(s)?;
|
||||
@ -520,7 +505,7 @@ pub fn expression_binary(s: Span) -> IResult<Span, Expression> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
|
||||
let (s, a) = keyword("tagged")(s)?;
|
||||
let (s, b) = member_identifier(s)?;
|
||||
@ -528,7 +513,7 @@ pub fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression>
|
||||
Ok((s, TaggedUnionExpression { nodes: (a, b, c) }))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
|
||||
let (s, a) = expression(s)?;
|
||||
let (s, b) = keyword("inside")(s)?;
|
||||
|
@ -7,16 +7,17 @@ use nom::combinator::*;
|
||||
use nom::multi::*;
|
||||
use nom::sequence::*;
|
||||
use nom::IResult;
|
||||
use nom_packrat::packrat_parser;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Number {
|
||||
IntegralNumber(IntegralNumber),
|
||||
RealNumber(RealNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum IntegralNumber {
|
||||
DecimalNumber(DecimalNumber),
|
||||
OctalNumber(OctalNumber),
|
||||
@ -24,7 +25,7 @@ pub enum IntegralNumber {
|
||||
HexNumber(HexNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DecimalNumber {
|
||||
UnsignedNumber(UnsignedNumber),
|
||||
BaseUnsigned(DecimalNumberBaseUnsigned),
|
||||
@ -32,59 +33,59 @@ pub enum DecimalNumber {
|
||||
BaseZNumber(DecimalNumberBaseZNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DecimalNumberBaseUnsigned {
|
||||
pub nodes: (Option<Size>, DecimalBase, UnsignedNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DecimalNumberBaseXNumber {
|
||||
pub nodes: (Option<Size>, DecimalBase, XNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DecimalNumberBaseZNumber {
|
||||
pub nodes: (Option<Size>, DecimalBase, ZNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinaryNumber {
|
||||
pub nodes: (Option<Size>, BinaryBase, BinaryValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OctalNumber {
|
||||
pub nodes: (Option<Size>, OctalBase, OctalValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HexNumber {
|
||||
pub nodes: (Option<Size>, HexBase, HexValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Sign {
|
||||
Plus(Symbol),
|
||||
Minus(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Size {
|
||||
pub nodes: (NonZeroUnsignedNumber,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonZeroUnsignedNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RealNumber {
|
||||
FixedPointNumber(FixedPointNumber),
|
||||
Floating(RealNumberFloating),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RealNumberFloating {
|
||||
pub nodes: (
|
||||
UnsignedNumber,
|
||||
@ -95,73 +96,74 @@ pub struct RealNumberFloating {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FixedPointNumber {
|
||||
pub nodes: (UnsignedNumber, Symbol, UnsignedNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Exp {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnsignedNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinaryValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OctalValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HexValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DecimalBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinaryBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OctalBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HexBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct XNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ZNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnbasedUnsizedLiteral {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn number(s: Span) -> IResult<Span, Number> {
|
||||
alt((
|
||||
|
@ -5,27 +5,27 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnaryOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinaryOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IncOrDecOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UnaryModulePathOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinaryModulePathOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
@ -4,10 +4,11 @@ use nom::branch::*;
|
||||
use nom::combinator::*;
|
||||
use nom::multi::*;
|
||||
use nom::IResult;
|
||||
use nom_packrat::packrat_parser;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstantPrimary {
|
||||
PrimaryLiteral(PrimaryLiteral),
|
||||
PsParameter(ConstantPrimaryPsParameter),
|
||||
@ -26,12 +27,12 @@ pub enum ConstantPrimary {
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryPsParameter {
|
||||
pub nodes: (PsParameterIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimarySpecparam {
|
||||
pub nodes: (
|
||||
SpecparamIdentifier,
|
||||
@ -39,17 +40,17 @@ pub struct ConstantPrimarySpecparam {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryFormalPort {
|
||||
pub nodes: (FormalPortIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryEnum {
|
||||
pub nodes: (PackageScopeOrClassScope, EnumIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryConcatenation {
|
||||
pub nodes: (
|
||||
ConstantConcatenation,
|
||||
@ -57,7 +58,7 @@ pub struct ConstantPrimaryConcatenation {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryMultipleConcatenation {
|
||||
pub nodes: (
|
||||
ConstantMultipleConcatenation,
|
||||
@ -65,12 +66,12 @@ pub struct ConstantPrimaryMultipleConcatenation {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantPrimaryMintypmaxExpression {
|
||||
pub nodes: (Paren<ConstantMintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModulePathPrimary {
|
||||
Number(Number),
|
||||
Identifier(Identifier),
|
||||
@ -80,12 +81,12 @@ pub enum ModulePathPrimary {
|
||||
Mintypmax(ModulePathPrimaryMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModulePathPrimaryMintypmax {
|
||||
pub nodes: (Paren<ModulePathMintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Primary {
|
||||
PrimaryLiteral(PrimaryLiteral),
|
||||
Hierarchical(PrimaryHierarchical),
|
||||
@ -104,7 +105,7 @@ pub enum Primary {
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PrimaryHierarchical {
|
||||
pub nodes: (
|
||||
Option<ClassQualifierOrPackageScope>,
|
||||
@ -113,45 +114,39 @@ pub struct PrimaryHierarchical {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PrimaryConcatenation {
|
||||
pub nodes: (Concatenation, Option<Bracket<RangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PrimaryMultipleConcatenation {
|
||||
pub nodes: (
|
||||
MultipleConcatenation,
|
||||
Option<Bracket< RangeExpression>>,
|
||||
),
|
||||
pub nodes: (MultipleConcatenation, Option<Bracket<RangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PrimaryMintypmaxExpression {
|
||||
pub nodes: (Paren<MintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassQualifierOrPackageScope {
|
||||
ClassQualifier(ClassQualifier),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassQualifier {
|
||||
pub nodes: (
|
||||
Option<Local>,
|
||||
Option<ImplicitClassHandleOrClassScope>,
|
||||
),
|
||||
pub nodes: (Option<Local>, Option<ImplicitClassHandleOrClassScope>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RangeExpression {
|
||||
Expression(Expression),
|
||||
PartSelectRange(PartSelectRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PrimaryLiteral {
|
||||
Number(Number),
|
||||
TimeLiteral(TimeLiteral),
|
||||
@ -159,23 +154,23 @@ pub enum PrimaryLiteral {
|
||||
StringLiteral(StringLiteral),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TimeLiteral {
|
||||
Unsigned(TimeLiteralUnsigned),
|
||||
FixedPoint(TimeLiteralFixedPoint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeLiteralUnsigned {
|
||||
pub nodes: (UnsignedNumber, TimeUnit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeLiteralFixedPoint {
|
||||
pub nodes: (FixedPointNumber, TimeUnit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TimeUnit {
|
||||
S(Keyword),
|
||||
MS(Keyword),
|
||||
@ -185,19 +180,19 @@ pub enum TimeUnit {
|
||||
FS(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImplicitClassHandle {
|
||||
This(Keyword),
|
||||
Super(Keyword),
|
||||
ThisSuper((Keyword, Symbol, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BitSelect {
|
||||
nodes: (Vec<Bracket<Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Select {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
@ -210,7 +205,7 @@ pub struct Select {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonrangeSelect {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
@ -222,12 +217,12 @@ pub struct NonrangeSelect {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantBitSelect {
|
||||
nodes: (Vec<Bracket<ConstantExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantSelect {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
@ -240,28 +235,25 @@ pub struct ConstantSelect {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantCast {
|
||||
pub nodes: (
|
||||
CastingType,
|
||||
Symbol,
|
||||
Paren< ConstantExpression>,
|
||||
),
|
||||
pub nodes: (CastingType, Symbol, Paren<ConstantExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantLetExpression {
|
||||
pub nodes: (LetExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Cast {
|
||||
pub nodes: (CastingType, Symbol, Paren<Expression>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
alt((
|
||||
map(keyword("null"), |x| ConstantPrimary::Null(x)),
|
||||
@ -288,7 +280,7 @@ pub fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = ps_parameter_identifier(s)?;
|
||||
let (s, b) = constant_select(s)?;
|
||||
@ -298,7 +290,7 @@ pub fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary>
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = specparam_identifier(s)?;
|
||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||
@ -308,7 +300,7 @@ pub fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = formal_port_identifier(s)?;
|
||||
let (s, b) = constant_select(s)?;
|
||||
@ -318,7 +310,7 @@ pub fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = package_scope_or_class_scope(s)?;
|
||||
let (s, b) = enum_identifier(s)?;
|
||||
@ -328,7 +320,7 @@ pub fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = constant_concatenation(s)?;
|
||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||
@ -338,7 +330,7 @@ pub fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary>
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = constant_multiple_concatenation(s)?;
|
||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||
@ -350,7 +342,7 @@ pub fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, Constan
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
let (s, a) = paren(constant_mintypmax_expression)(s)?;
|
||||
Ok((
|
||||
@ -386,7 +378,8 @@ pub fn module_path_primary_mintypmax_expression(s: Span) -> IResult<Span, Module
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn primary(s: Span) -> IResult<Span, Primary> {
|
||||
alt((
|
||||
map(keyword("this"), |x| Primary::This(x)),
|
||||
@ -414,7 +407,7 @@ pub fn primary(s: Span) -> IResult<Span, Primary> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
|
||||
let (s, a) = opt(class_qualifier_or_package_scope)(s)?;
|
||||
let (s, b) = hierarchical_identifier(s)?;
|
||||
@ -425,7 +418,7 @@ pub fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
|
||||
let (s, a) = concatenation(s)?;
|
||||
let (s, b) = opt(bracket(range_expression))(s)?;
|
||||
@ -445,7 +438,7 @@ pub fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
|
||||
let (s, a) = paren(mintypmax_expression)(s)?;
|
||||
Ok((
|
||||
@ -481,7 +474,7 @@ pub fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
|
||||
alt((
|
||||
map(time_literal, |x| PrimaryLiteral::TimeLiteral(x)),
|
||||
@ -589,7 +582,7 @@ pub fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
|
||||
Ok((s, ConstantSelect { nodes: (a, b, c) }))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
|
||||
let (s, a) = casting_type(s)?;
|
||||
let (s, b) = symbol("'")(s)?;
|
||||
@ -597,13 +590,13 @@ pub fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
|
||||
Ok((s, ConstantCast { nodes: (a, b, c) }))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
|
||||
let (s, a) = let_expression(s)?;
|
||||
Ok((s, ConstantLetExpression { nodes: (a,) }))
|
||||
}
|
||||
|
||||
#[parser(MaybeRecursive, Memoize)]
|
||||
#[parser(MaybeRecursive)]
|
||||
pub fn cast(s: Span) -> IResult<Span, Cast> {
|
||||
let (s, a) = casting_type(s)?;
|
||||
let (s, b) = symbol("'")(s)?;
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StringLiteral {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstantFunctionCall {
|
||||
pub nodes: (FunctionSubroutineCall,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TfCall {
|
||||
pub nodes: (
|
||||
PsOrHierarchicalTfIdentifier,
|
||||
@ -22,22 +22,19 @@ pub struct TfCall {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SystemTfCall {
|
||||
ArgOptionl(SystemTfCallArgOptional),
|
||||
ArgDataType(SystemTfCallArgDataType),
|
||||
ArgExpression(SystemTfCallArgExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SystemTfCallArgOptional {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
),
|
||||
pub nodes: (SystemTfIdentifier, Option<Paren<ListOfArguments>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SystemTfCallArgDataType {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier,
|
||||
@ -45,21 +42,18 @@ pub struct SystemTfCallArgDataType {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SystemTfCallArgExpression {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier,
|
||||
Paren<
|
||||
|
||||
(
|
||||
Paren<(
|
||||
List<Symbol, Option<Expression>>,
|
||||
Option<(Symbol, Option<ClockingEvent>)>,
|
||||
),
|
||||
>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SubroutineCall {
|
||||
TfCall(Box<TfCall>),
|
||||
SystemTfCall(Box<SystemTfCall>),
|
||||
@ -67,62 +61,52 @@ pub enum SubroutineCall {
|
||||
Randomize(Box<SubroutineCallRandomize>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SubroutineCallRandomize {
|
||||
pub nodes: (Option<(Keyword, Symbol)>, RandomizeCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionSubroutineCall {
|
||||
pub nodes: (SubroutineCall,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ListOfArguments {
|
||||
Ordered(ListOfArgumentsOrdered),
|
||||
Named(ListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol, Option<Expression>>,
|
||||
Vec<(
|
||||
Symbol,
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren< Option<Expression>>,
|
||||
)>,
|
||||
Vec<(Symbol, Symbol, Identifier, Paren<Option<Expression>>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfArgumentsNamed {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren<Option<Expression>>,
|
||||
Vec<(
|
||||
Symbol,
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren< Option<Expression>>,
|
||||
)>,
|
||||
Vec<(Symbol, Symbol, Identifier, Paren<Option<Expression>>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MethodCall {
|
||||
pub nodes: (MethodCallRoot, Symbol, MethodCallBody),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum MethodCallBody {
|
||||
User(MethodCallBodyUser),
|
||||
BuiltInMethodCall(BuiltInMethodCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MethodCallBodyUser {
|
||||
pub nodes: (
|
||||
MethodIdentifier,
|
||||
@ -131,13 +115,13 @@ pub struct MethodCallBodyUser {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BuiltInMethodCall {
|
||||
ArrayManipulationCall(ArrayManipulationCall),
|
||||
RandomizeCall(RandomizeCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ArrayManipulationCall {
|
||||
pub nodes: (
|
||||
ArrayMethodName,
|
||||
@ -147,7 +131,7 @@ pub struct ArrayManipulationCall {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RandomizeCall {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -161,19 +145,19 @@ pub struct RandomizeCall {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum VariableIdentifierListOrNull {
|
||||
VariableIdentifierList(VariableIdentifierList),
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum MethodCallRoot {
|
||||
Primary(Primary),
|
||||
ImplicitClassHandle(ImplicitClassHandle),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ArrayMethodName {
|
||||
MethodIdentifier(MethodIdentifier),
|
||||
Unique(Keyword),
|
||||
@ -262,7 +246,7 @@ pub fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
|
||||
))
|
||||
}
|
||||
|
||||
#[parser(Memoize)]
|
||||
#[parser]
|
||||
pub fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
|
||||
map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s)
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AttributeInstance {
|
||||
pub nodes: (Symbol, List<Symbol, AttrSpec>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AttrSpec {
|
||||
pub nodes: (Identifier, Option<(Symbol, ConstantExpression)>),
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Comment {
|
||||
nodes: (Locate,),
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ use nom::error::*;
|
||||
use nom::multi::*;
|
||||
use nom::sequence::*;
|
||||
use nom::{Err, IResult};
|
||||
use nom_packrat::packrat_parser;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@ -14,142 +15,142 @@ pub const AZ_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
||||
pub const AZ09_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
|
||||
pub const AZ09_DOLLAR: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ArrayIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BlockIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BinIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CellIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClockingIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CovergroupVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CoverPointIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CrossIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DynamicArrayVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnumIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EscapedIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FormalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FormalPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FunctionIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenerateBlockIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalArrayIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalBlockIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalEventIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalIdentifier {
|
||||
pub nodes: (
|
||||
Option<Root>,
|
||||
@ -158,189 +159,189 @@ pub struct HierarchicalIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Root {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalNetIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalParameterIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalPropertyIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalSequenceIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalTaskIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalTfIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalVariableIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Identifier {
|
||||
SimpleIdentifier(SimpleIdentifier),
|
||||
EscapedIdentifier(EscapedIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IndexVariableIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceInstanceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InoutPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InputPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InstanceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LibraryIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MemberIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MethodIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModportIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetTypeIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageScope {
|
||||
Package(PackageScopePackage),
|
||||
Unit(Unit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageScopePackage {
|
||||
pub nodes: (PackageIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Unit {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProductionIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsClassIdentifier {
|
||||
pub nodes: (Option<PackageScope>, ClassIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsCovergroupIdentifier {
|
||||
pub nodes: (Option<PackageScope>, CovergroupIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsCheckerIdentifier {
|
||||
pub nodes: (Option<PackageScope>, CheckerIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsIdentifier {
|
||||
pub nodes: (Option<PackageScope>, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalArrayIdentifier {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope>,
|
||||
@ -348,82 +349,82 @@ pub struct PsOrHierarchicalArrayIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PsOrHierarchicalNetIdentifier {
|
||||
PackageScope(PsOrHierarchicalNetIdentifierPackageScope),
|
||||
HierarchicalNetIdentifier(HierarchicalNetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalNetIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, NetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalNetIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalNetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PsOrHierarchicalPropertyIdentifier {
|
||||
PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope),
|
||||
HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalPropertyIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, PropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalPropertyIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalPropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PsOrHierarchicalSequenceIdentifier {
|
||||
PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope),
|
||||
HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalSequenceIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, SequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalSequenceIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PsOrHierarchicalTfIdentifier {
|
||||
PackageScope(PsOrHierarchicalTfIdentifierPackageScope),
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalTfIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, TfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsOrHierarchicalTfIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalTfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PsParameterIdentifier {
|
||||
Scope(PsParameterIdentifierScope),
|
||||
Generate(PsParameterIdentifierGenerate),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsParameterIdentifierScope {
|
||||
pub nodes: (Option<PackageScopeOrClassScope>, ParameterIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsParameterIdentifierGenerate {
|
||||
pub nodes: (
|
||||
Vec<(
|
||||
@ -435,103 +436,103 @@ pub struct PsParameterIdentifierGenerate {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PsTypeIdentifier {
|
||||
pub nodes: (Option<LocalOrPackageScopeOrClassScope>, TypeIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LocalOrPackageScopeOrClassScope {
|
||||
Local(Local),
|
||||
PackageScope(PackageScope),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Local {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SignalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimpleIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecparamIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SystemTfIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TaskIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TfIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TerminalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TopmoduleIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TypeIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariableIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrClassScopeOrPackageScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrPackageScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrClassScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageScopeOrClassScope {
|
||||
PackageScope(PackageScope),
|
||||
ClassScope(ClassScope),
|
||||
@ -725,6 +726,7 @@ pub fn hierarchical_event_identifier(s: Span) -> IResult<Span, HierarchicalEvent
|
||||
Ok((s, HierarchicalEventIdentifier { nodes: (a,) }))
|
||||
}
|
||||
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier> {
|
||||
let (s, a) = opt(root)(s)?;
|
||||
@ -784,6 +786,7 @@ pub fn hierarchical_variable_identifier(s: Span) -> IResult<Span, HierarchicalVa
|
||||
Ok((s, HierarchicalVariableIdentifier { nodes: (a,) }))
|
||||
}
|
||||
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn identifier(s: Span) -> IResult<Span, Identifier> {
|
||||
alt((
|
||||
@ -1200,6 +1203,7 @@ pub fn udp_identifier(s: Span) -> IResult<Span, UdpIdentifier> {
|
||||
Ok((s, UdpIdentifier { nodes: (a,) }))
|
||||
}
|
||||
|
||||
#[packrat_parser]
|
||||
#[parser]
|
||||
pub fn variable_identifier(s: Span) -> IResult<Span, VariableIdentifier> {
|
||||
let (s, a) = identifier(s)?;
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerInstantiation {
|
||||
pub nodes: (
|
||||
PsCheckerIdentifier,
|
||||
@ -17,34 +17,34 @@ pub struct CheckerInstantiation {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ListOfCheckerPortConnections {
|
||||
Ordered(ListOfCheckerPortConnectionsOrdered),
|
||||
Named(ListOfCheckerPortConnectionsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfCheckerPortConnectionsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedCheckerPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfCheckerPortConnectionsNamed {
|
||||
pub nodes: (List<Symbol, NamedCheckerPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OrderedCheckerPortConnection {
|
||||
pub nodes: (Vec<AttributeInstance>, Option<PropertyActualArg>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NamedCheckerPortConnection {
|
||||
Identifier(NamedCheckerPortConnectionIdentifier),
|
||||
Asterisk(NamedCheckerPortConnectionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NamedCheckerPortConnectionIdentifier {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -54,7 +54,7 @@ pub struct NamedCheckerPortConnectionIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NamedCheckerPortConnectionAsterisk {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenerateRegion {
|
||||
pub nodes: (Keyword, Vec<GenerateItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LoopGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -31,7 +31,7 @@ pub struct LoopGenerateConstruct {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarInitialization {
|
||||
pub nodes: (
|
||||
Option<Genvar>,
|
||||
@ -41,19 +41,19 @@ pub struct GenvarInitialization {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Genvar {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum GenvarIteration {
|
||||
Assignment(GenvarIterationAssignment),
|
||||
Prefix(GenvarIterationPrefix),
|
||||
Suffix(GenvarIterationSuffix),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarIterationAssignment {
|
||||
pub nodes: (
|
||||
GenvarIdentifier,
|
||||
@ -62,23 +62,23 @@ pub struct GenvarIterationAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarIterationPrefix {
|
||||
pub nodes: (IncOrDecOperator, GenvarIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenvarIterationSuffix {
|
||||
pub nodes: (GenvarIdentifier, IncOrDecOperator),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConditionalGenerateConstruct {
|
||||
If(IfGenerateConstruct),
|
||||
Case(CaseGenerateConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IfGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -88,7 +88,7 @@ pub struct IfGenerateConstruct {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -98,13 +98,13 @@ pub struct CaseGenerateConstruct {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CaseGenerateItem {
|
||||
Nondefault(CaseGenerateItemNondefault),
|
||||
Default(CaseGenerateItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseGenerateItemNondefault {
|
||||
pub nodes: (
|
||||
List<Symbol, ConstantExpression>,
|
||||
@ -113,18 +113,18 @@ pub struct CaseGenerateItemNondefault {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CaseGenerateItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, GenerateBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum GenerateBlock {
|
||||
GenerateItem(GenerateItem),
|
||||
Multiple(GenerateBlockMultiple),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GenerateBlockMultiple {
|
||||
pub nodes: (
|
||||
Option<(GenerateBlockIdentifier, Symbol)>,
|
||||
@ -136,7 +136,7 @@ pub struct GenerateBlockMultiple {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum GenerateItem {
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem),
|
||||
|
@ -5,7 +5,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceInstantiation {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier,
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleInstantiation {
|
||||
pub nodes: (
|
||||
ModuleIdentifier,
|
||||
@ -17,7 +17,7 @@ pub struct ModuleInstantiation {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterValueAssignment {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -25,28 +25,28 @@ pub struct ParameterValueAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ListOfParameterAssignments {
|
||||
Ordered(ListOfParameterAssignmentsOrdered),
|
||||
Named(ListOfParameterAssignmentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfParameterAssignmentsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedParameterAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfParameterAssignmentsNamed {
|
||||
pub nodes: (List<Symbol, NamedParameterAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OrderedParameterAssignment {
|
||||
pub nodes: (ParamExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NamedParameterAssignment {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -55,7 +55,7 @@ pub struct NamedParameterAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HierarchicalInstance {
|
||||
pub nodes: (
|
||||
NameOfInstance,
|
||||
@ -63,39 +63,39 @@ pub struct HierarchicalInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NameOfInstance {
|
||||
pub nodes: (InstanceIdentifier, Vec<UnpackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ListOfPortConnections {
|
||||
Ordered(ListOfPortConnectionsOrdered),
|
||||
Named(ListOfPortConnectionsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPortConnectionsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPortConnectionsNamed {
|
||||
pub nodes: (List<Symbol, NamedPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OrderedPortConnection {
|
||||
pub nodes: (Vec<AttributeInstance>, Option<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NamedPortConnection {
|
||||
Identifier(NamedPortConnectionIdentifier),
|
||||
Asterisk(NamedPortConnectionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NamedPortConnectionIdentifier {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -105,7 +105,7 @@ pub struct NamedPortConnectionIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NamedPortConnectionAsterisk {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramInstantiation {
|
||||
pub nodes: (
|
||||
ProgramIdentifier,
|
||||
|
@ -5,37 +5,37 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CmosSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnableGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MosSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NInputGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NOutputGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PassEnSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PassSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum GateInstantiation {
|
||||
Cmos(GateInstantiationCmos),
|
||||
Enable(GateInstantiationEnable),
|
||||
@ -20,7 +20,7 @@ pub enum GateInstantiation {
|
||||
Pullup(GateInstantiationPullup),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationCmos {
|
||||
pub nodes: (
|
||||
CmosSwitchtype,
|
||||
@ -30,7 +30,7 @@ pub struct GateInstantiationCmos {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationEnable {
|
||||
pub nodes: (
|
||||
EnableGatetype,
|
||||
@ -41,7 +41,7 @@ pub struct GateInstantiationEnable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationMos {
|
||||
pub nodes: (
|
||||
MosSwitchtype,
|
||||
@ -51,7 +51,7 @@ pub struct GateInstantiationMos {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationNInput {
|
||||
pub nodes: (
|
||||
NInputGatetype,
|
||||
@ -62,7 +62,7 @@ pub struct GateInstantiationNInput {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationNOutput {
|
||||
pub nodes: (
|
||||
NOutputGatetype,
|
||||
@ -73,7 +73,7 @@ pub struct GateInstantiationNOutput {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationPassEn {
|
||||
pub nodes: (
|
||||
PassEnSwitchtype,
|
||||
@ -83,7 +83,7 @@ pub struct GateInstantiationPassEn {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationPass {
|
||||
pub nodes: (
|
||||
PassSwitchtype,
|
||||
@ -92,7 +92,7 @@ pub struct GateInstantiationPass {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationPulldown {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -102,7 +102,7 @@ pub struct GateInstantiationPulldown {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct GateInstantiationPullup {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -112,7 +112,7 @@ pub struct GateInstantiationPullup {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CmosSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -131,7 +131,7 @@ pub struct CmosSwitchInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnableGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -148,7 +148,7 @@ pub struct EnableGateInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct MosSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -165,7 +165,7 @@ pub struct MosSwitchInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NInputGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -180,7 +180,7 @@ pub struct NInputGateInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NOutputGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -195,7 +195,7 @@ pub struct NOutputGateInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PassSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -203,7 +203,7 @@ pub struct PassSwitchInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PassEnableSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
@ -220,7 +220,7 @@ pub struct PassEnableSwitchInstance {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PullGateInstance {
|
||||
pub nodes: (Option<NameOfInstance>, Paren< OutputTerminal>),
|
||||
}
|
||||
|
@ -5,46 +5,46 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PulldownStrength {
|
||||
Strength01(PulldownStrength01),
|
||||
Strength10(PulldownStrength10),
|
||||
Strength0(PulldownStrength0),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulldownStrength01 {
|
||||
pub nodes: (Paren< (Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulldownStrength10 {
|
||||
pub nodes: (Paren< (Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulldownStrength0 {
|
||||
pub nodes: (Paren< Strength0>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PullupStrength {
|
||||
Strength01(PullupStrength01),
|
||||
Strength10(PullupStrength10),
|
||||
Strength1(PullupStrength1),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PullupStrength01 {
|
||||
pub nodes: (Paren< (Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PullupStrength10 {
|
||||
pub nodes: (Paren< (Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PullupStrength1 {
|
||||
pub nodes: (Paren< Strength1>,),
|
||||
}
|
||||
|
@ -4,32 +4,32 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EnableTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InoutTerminal {
|
||||
pub nodes: (NetLvalue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InputTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NcontrolTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputTerminal {
|
||||
pub nodes: (NetLvalue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PcontrolTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerPortList {
|
||||
pub nodes: (List<Symbol, CheckerPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -25,13 +25,13 @@ pub struct CheckerPortItem {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CheckerPortDirection {
|
||||
Input(Keyword),
|
||||
Output(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CheckerOrGenerateItem {
|
||||
CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration),
|
||||
InitialConstruct(InitialConstruct),
|
||||
@ -42,7 +42,7 @@ pub enum CheckerOrGenerateItem {
|
||||
CheckerGenerateItem(CheckerGenerateItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CheckerOrGenerateItemDeclaration {
|
||||
Data(CheckerOrGenerateItemDeclarationData),
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
@ -56,22 +56,22 @@ pub enum CheckerOrGenerateItemDeclaration {
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationData {
|
||||
pub nodes: (Option<Rand>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Rand {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationClocking {
|
||||
pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationDisable {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -82,7 +82,7 @@ pub struct CheckerOrGenerateItemDeclarationDisable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum CheckerGenerateItem {
|
||||
LoopGenerateConstruct(Box<LoopGenerateConstruct>),
|
||||
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct>),
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassItem {
|
||||
Property(ClassItemProperty),
|
||||
Method(ClassItemMethod),
|
||||
@ -20,43 +20,43 @@ pub enum ClassItem {
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassItemProperty {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassProperty),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassItemMethod {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassItemConstraint {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassConstraint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassItemDeclaration {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassItemCovergroup {
|
||||
pub nodes: (Vec<AttributeInstance>, CovergroupDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassProperty {
|
||||
NonConst(ClassPropertyNonConst),
|
||||
Const(ClassPropertyConst),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassPropertyNonConst {
|
||||
pub nodes: (Vec<PropertyQualifier>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassPropertyConst {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -68,7 +68,7 @@ pub struct ClassPropertyConst {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassMethod {
|
||||
Task(ClassMethodTask),
|
||||
Function(ClassMethodFunction),
|
||||
@ -78,17 +78,17 @@ pub enum ClassMethod {
|
||||
ExternConstructor(ClassMethodExternConstructor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodTask {
|
||||
pub nodes: (Vec<MethodQualifier>, TaskDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodFunction {
|
||||
pub nodes: (Vec<MethodQualifier>, FunctionDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodPureVirtual {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -99,7 +99,7 @@ pub struct ClassMethodPureVirtual {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodExternMethod {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -109,12 +109,12 @@ pub struct ClassMethodExternMethod {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodConstructor {
|
||||
pub nodes: (Vec<MethodQualifier>, ClassConstructorDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassMethodExternConstructor {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -123,7 +123,7 @@ pub struct ClassMethodExternConstructor {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassConstructorPrototype {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -133,45 +133,45 @@ pub struct ClassConstructorPrototype {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassConstraint {
|
||||
ConstraintPrototype(ConstraintPrototype),
|
||||
ConstraintDeclaration(ConstraintDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ClassItemQualifier {
|
||||
Static(Keyword),
|
||||
Protected(Keyword),
|
||||
Local(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PropertyQualifier {
|
||||
RandomQualifier(RandomQualifier),
|
||||
ClassItemQualifier(ClassItemQualifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum RandomQualifier {
|
||||
Rand(Keyword),
|
||||
Randc(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum MethodQualifier {
|
||||
Virtual(Keyword),
|
||||
PureVirtual((Keyword, Keyword)),
|
||||
ClassItemQualifier(ClassItemQualifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum MethodPrototype {
|
||||
TaskPrototype(TaskPrototype),
|
||||
FunctionPrototype(FunctionPrototype),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassConstructorDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -193,7 +193,7 @@ pub struct ClassConstructorDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct New {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -22,7 +22,7 @@ pub struct ConfigDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DesignStatement {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -34,7 +34,7 @@ pub struct DesignStatement {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConfigRuleStatement {
|
||||
Default(ConfigRuleStatementDefault),
|
||||
InstLib(ConfigRuleStatementInstLib),
|
||||
@ -43,42 +43,42 @@ pub enum ConfigRuleStatement {
|
||||
CellUse(ConfigRuleStatementCellUse),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigRuleStatementDefault {
|
||||
pub nodes: (DefaultClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigRuleStatementInstLib {
|
||||
pub nodes: (InstClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigRuleStatementInstUse {
|
||||
pub nodes: (InstClause, UseClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigRuleStatementCellLib {
|
||||
pub nodes: (CellClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConfigRuleStatementCellUse {
|
||||
pub nodes: (CellClause, UseClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DefaultClause {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InstClause {
|
||||
pub nodes: (Keyword, InstName),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InstName {
|
||||
pub nodes: (
|
||||
TopmoduleIdentifier,
|
||||
@ -86,7 +86,7 @@ pub struct InstName {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CellClause {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -95,19 +95,19 @@ pub struct CellClause {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LiblistClause {
|
||||
pub nodes: (Keyword, Vec<LibraryIdentifier>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UseClause {
|
||||
Cell(UseClauseCell),
|
||||
Named(UseClauseNamed),
|
||||
CellNamed(UseClauseCellNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UseClauseCell {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -117,7 +117,7 @@ pub struct UseClauseCell {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UseClauseNamed {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -126,7 +126,7 @@ pub struct UseClauseNamed {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UseClauseCellNamed {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -137,7 +137,7 @@ pub struct UseClauseCellNamed {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Config {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintDeclaration {
|
||||
pub nodes: (
|
||||
Option<Static>,
|
||||
@ -18,23 +18,23 @@ pub struct ConstraintDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Static {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintBlock {
|
||||
pub nodes: (Brace< Vec<ConstraintBlockItem>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstraintBlockItem {
|
||||
Solve(ConstraintBlockItemSolve),
|
||||
ConstraintExpression(ConstraintExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintBlockItemSolve {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -45,12 +45,12 @@ pub struct ConstraintBlockItemSolve {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SolveBeforeList {
|
||||
pub nodes: (List<Symbol, ConstraintPrimary>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintPrimary {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScope>,
|
||||
@ -59,7 +59,7 @@ pub struct ConstraintPrimary {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstraintExpression {
|
||||
Expression(ConstraintExpressionExpression),
|
||||
UniquenessConstraint((UniquenessConstraint, Symbol)),
|
||||
@ -69,22 +69,22 @@ pub enum ConstraintExpression {
|
||||
Disable(ConstraintExpressionDisable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintExpressionExpression {
|
||||
pub nodes: (Option<Soft>, ExpressionOrDist, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Soft {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintExpressionArrow {
|
||||
pub nodes: (Expression, Symbol, ConstraintSet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintExpressionIf {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -94,7 +94,7 @@ pub struct ConstraintExpressionIf {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintExpressionForeach {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -109,54 +109,54 @@ pub struct ConstraintExpressionForeach {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintExpressionDisable {
|
||||
pub nodes: (Keyword, Keyword, ConstraintPrimary, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UniquenessConstraint {
|
||||
pub nodes: (Keyword, Brace< OpenRangeList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstraintSet {
|
||||
ConstraintExpression(Box<ConstraintExpression>),
|
||||
Brace(ConstraintSetBrace),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintSetBrace {
|
||||
pub nodes: (Brace< Vec<ConstraintExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DistList {
|
||||
pub nodes: (List<Symbol, DistItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DistItem {
|
||||
pub nodes: (ValueRange, Option<DistWeight>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DistWeight {
|
||||
Equal(DistWeightEqual),
|
||||
Divide(DistWeightDivide),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DistWeightEqual {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DistWeightDivide {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ConstraintPrototype {
|
||||
pub nodes: (
|
||||
Option<ConstraintPrototypeQualifier>,
|
||||
@ -167,13 +167,13 @@ pub struct ConstraintPrototype {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ConstraintPrototypeQualifier {
|
||||
Extern(Keyword),
|
||||
Pure(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExternConstraintDeclaration {
|
||||
pub nodes: (
|
||||
Option<Static>,
|
||||
@ -184,7 +184,7 @@ pub struct ExternConstraintDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IdentifierList {
|
||||
pub nodes: (List<Symbol, Identifier>,),
|
||||
}
|
||||
|
@ -8,45 +8,45 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfaceOrGenerateItem {
|
||||
Module(InterfaceOrGenerateItemModule),
|
||||
Extern(InterfaceOrGenerateItemExtern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceOrGenerateItemModule {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleCommonItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceOrGenerateItemExtern {
|
||||
pub nodes: (Vec<AttributeInstance>, ExternTfDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ExternTfDeclaration {
|
||||
Method(ExternTfDeclarationMethod),
|
||||
Task(ExternTfDeclarationTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExternTfDeclarationMethod {
|
||||
pub nodes: (Keyword, MethodPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ExternTfDeclarationTask {
|
||||
pub nodes: (Keyword, Keyword, TaskPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfaceItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortInterfaceItem(NonPortInterfaceItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NonPortInterfaceItem {
|
||||
GenerateRegion(GenerateRegion),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem),
|
||||
|
@ -8,12 +8,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LibraryText {
|
||||
pub nodes: (Vec<LibraryDescription>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum LibraryDescription {
|
||||
LibraryDeclaration(LibraryDeclaration),
|
||||
IncludeStatement(IncludeStatement),
|
||||
@ -21,7 +21,7 @@ pub enum LibraryDescription {
|
||||
Null(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LibraryDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -32,12 +32,12 @@ pub struct LibraryDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct IncludeStatement {
|
||||
pub nodes: (Keyword, FilePathSpec, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FilePathSpec {
|
||||
pub nodes: (StringLiteral,),
|
||||
}
|
||||
|
@ -8,15 +8,15 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ElaborationSystemTask {
|
||||
Fatal(ElaborationSystemTaskFatal),
|
||||
Error(ElaborationSystemTaskError),
|
||||
Warning(ElaborationSystemTaskWarning),
|
||||
Info(ElaborationSystemTaskInfo),
|
||||
TaskFatal(ElaborationSystemTaskFatal),
|
||||
TaskError(ElaborationSystemTaskError),
|
||||
TaskWarning(ElaborationSystemTaskWarning),
|
||||
TaskInfo(ElaborationSystemTaskInfo),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ElaborationSystemTaskFatal {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -25,41 +25,29 @@ pub struct ElaborationSystemTaskFatal {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ElaborationSystemTaskError {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
pub nodes: (Keyword, Option<Paren<Option<ListOfArguments>>>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ElaborationSystemTaskWarning {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
pub nodes: (Keyword, Option<Paren<Option<ListOfArguments>>>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ElaborationSystemTaskInfo {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
pub nodes: (Keyword, Option<Paren<Option<ListOfArguments>>>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum FinishNumber {
|
||||
Zero(Symbol),
|
||||
One(Symbol),
|
||||
Two(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleCommonItem {
|
||||
ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration),
|
||||
InterfaceInstantiation(InterfaceInstantiation),
|
||||
@ -76,13 +64,13 @@ pub enum ModuleCommonItem {
|
||||
ElaborationSystemTask(ElaborationSystemTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortModuleItem(NonPortModuleItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleOrGenerateItem {
|
||||
Parameter(ModuleOrGenerateItemParameter),
|
||||
Gate(ModuleOrGenerateItemGate),
|
||||
@ -91,32 +79,32 @@ pub enum ModuleOrGenerateItem {
|
||||
ModuleItem(Box<ModuleOrGenerateItemModuleItem>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemParameter {
|
||||
pub nodes: (Vec<AttributeInstance>, ParameterOverride),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemGate {
|
||||
pub nodes: (Vec<AttributeInstance>, GateInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemUdp {
|
||||
pub nodes: (Vec<AttributeInstance>, UdpInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemModule {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemModuleItem {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleCommonItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleOrGenerateItemDeclaration {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration),
|
||||
GenvarDeclaration(GenvarDeclaration),
|
||||
@ -125,23 +113,17 @@ pub enum ModuleOrGenerateItemDeclaration {
|
||||
Disable(ModuleOrGenerateItemDeclarationDisable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemDeclarationClocking {
|
||||
pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemDeclarationDisable {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
Keyword,
|
||||
Keyword,
|
||||
ExpressionOrDist,
|
||||
Symbol,
|
||||
),
|
||||
pub nodes: (Keyword, Keyword, Keyword, ExpressionOrDist, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NonPortModuleItem {
|
||||
GenerateRegion(GenerateRegion),
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem),
|
||||
@ -153,23 +135,23 @@ pub enum NonPortModuleItem {
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortModuleItemSpecparam {
|
||||
pub nodes: (Vec<AttributeInstance>, SpecparamDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterOverride {
|
||||
pub nodes: (Keyword, ListOfDefparamAssignments, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BindDirective {
|
||||
Scope(BindDirectiveScope),
|
||||
Instance(BindDirectiveInstance),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BindDirectiveScope {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -180,33 +162,28 @@ pub struct BindDirectiveScope {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BindDirectiveInstance {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
BindTargetInstance,
|
||||
BindInstantiation,
|
||||
Symbol,
|
||||
),
|
||||
pub nodes: (Keyword, BindTargetInstance, BindInstantiation, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BindTargetScope {
|
||||
ModuleIdentifier(ModuleIdentifier),
|
||||
InterfaceIdentifier(InterfaceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BindTargetInstance {
|
||||
pub nodes: (HierarchicalIdentifier, ConstantBitSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BindTargetInstanceList {
|
||||
pub nodes: (List<Symbol, BindTargetInstance>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum BindInstantiation {
|
||||
ProgramInstantiation(ProgramInstantiation),
|
||||
ModuleInstantiation(ModuleInstantiation),
|
||||
@ -236,7 +213,7 @@ pub fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystem
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
ElaborationSystemTask::Fatal(ElaborationSystemTaskFatal { nodes: (a, b, c) }),
|
||||
ElaborationSystemTask::TaskFatal(ElaborationSystemTaskFatal { nodes: (a, b, c) }),
|
||||
))
|
||||
}
|
||||
|
||||
@ -247,7 +224,7 @@ pub fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystem
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
ElaborationSystemTask::Error(ElaborationSystemTaskError { nodes: (a, b, c) }),
|
||||
ElaborationSystemTask::TaskError(ElaborationSystemTaskError { nodes: (a, b, c) }),
|
||||
))
|
||||
}
|
||||
|
||||
@ -258,7 +235,7 @@ pub fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSyst
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
ElaborationSystemTask::Warning(ElaborationSystemTaskWarning { nodes: (a, b, c) }),
|
||||
ElaborationSystemTask::TaskWarning(ElaborationSystemTaskWarning { nodes: (a, b, c) }),
|
||||
))
|
||||
}
|
||||
|
||||
@ -269,7 +246,7 @@ pub fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemT
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
ElaborationSystemTask::Info(ElaborationSystemTaskInfo { nodes: (a, b, c) }),
|
||||
ElaborationSystemTask::TaskInfo(ElaborationSystemTaskInfo { nodes: (a, b, c) }),
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -8,14 +8,14 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ParameterPortList {
|
||||
Assignment(ParameterPortListAssignment),
|
||||
Declaration(ParameterPortListDeclaration),
|
||||
Empty((Symbol, Symbol, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterPortListAssignment {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -29,7 +29,7 @@ pub struct ParameterPortListAssignment {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterPortListDeclaration {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -37,7 +37,7 @@ pub struct ParameterPortListDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ParameterPortDeclaration {
|
||||
ParameterDeclaration(ParameterDeclaration),
|
||||
LocalParameterDeclaration(LocalParameterDeclaration),
|
||||
@ -45,29 +45,29 @@ pub enum ParameterPortDeclaration {
|
||||
TypeList(ParameterPortDeclarationTypeList),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterPortDeclarationParamList {
|
||||
pub nodes: (DataType, ListOfParamAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParameterPortDeclarationTypeList {
|
||||
pub nodes: (Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPorts {
|
||||
pub nodes: (Paren< List<Symbol, Port>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPortDeclarations {
|
||||
pub nodes: (
|
||||
Paren< Option<List<Symbol, (Vec<AttributeInstance>, AnsiPortDeclaration)>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PortDeclaration {
|
||||
Inout(PortDeclarationInout),
|
||||
Input(PortDeclarationInput),
|
||||
@ -76,43 +76,43 @@ pub enum PortDeclaration {
|
||||
Interface(PortDeclarationInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortDeclarationInout {
|
||||
pub nodes: (Vec<AttributeInstance>, InoutDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortDeclarationInput {
|
||||
pub nodes: (Vec<AttributeInstance>, InputDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortDeclarationOutput {
|
||||
pub nodes: (Vec<AttributeInstance>, OutputDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortDeclarationRef {
|
||||
pub nodes: (Vec<AttributeInstance>, RefDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortDeclarationInterface {
|
||||
pub nodes: (Vec<AttributeInstance>, InterfacePortDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Port {
|
||||
NonNamed(PortNonNamed),
|
||||
Named(PortNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortNonNamed {
|
||||
pub nodes: (Option<PortExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortNamed {
|
||||
pub nodes: (
|
||||
Symbol,
|
||||
@ -121,23 +121,23 @@ pub struct PortNamed {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PortExpression {
|
||||
PortReference(PortReference),
|
||||
Brace(PortExpressionBrace),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortExpressionBrace {
|
||||
pub nodes: (Brace< List<Symbol, PortReference>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PortReference {
|
||||
pub nodes: (PortIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PortDirection {
|
||||
Input(Keyword),
|
||||
Output(Keyword),
|
||||
@ -145,23 +145,23 @@ pub enum PortDirection {
|
||||
Ref(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NetPortHeader {
|
||||
pub nodes: (Option<PortDirection>, NetPortType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct VariablePortHeader {
|
||||
pub nodes: (Option<PortDirection>, VariablePortType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfacePortHeader {
|
||||
Identifier(InterfacePortHeaderIdentifier),
|
||||
Interface(InterfacePortHeaderInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfacePortHeaderIdentifier {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier,
|
||||
@ -169,24 +169,24 @@ pub struct InterfacePortHeaderIdentifier {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfacePortHeaderInterface {
|
||||
pub nodes: (Keyword, Option<(Symbol, ModportIdentifier)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NetPortHeaderOrInterfacePortHeader {
|
||||
NetPortHeader(NetPortHeader),
|
||||
InterfacePortHeader(InterfacePortHeader),
|
||||
}
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AnsiPortDeclaration {
|
||||
Net(AnsiPortDeclarationNet),
|
||||
Variable(AnsiPortDeclarationVariable),
|
||||
Paren(AnsiPortDeclarationParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AnsiPortDeclarationNet {
|
||||
pub nodes: (
|
||||
Option<NetPortHeaderOrInterfacePortHeader>,
|
||||
@ -196,7 +196,7 @@ pub struct AnsiPortDeclarationNet {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AnsiPortDeclarationVariable {
|
||||
pub nodes: (
|
||||
Option<VariablePortHeader>,
|
||||
@ -206,7 +206,7 @@ pub struct AnsiPortDeclarationVariable {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AnsiPortDeclarationParen {
|
||||
pub nodes: (
|
||||
Option<PortDirection>,
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageItem {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration),
|
||||
AnonymousProgram(AnonymousProgram),
|
||||
@ -16,7 +16,7 @@ pub enum PackageItem {
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PackageOrGenerateItemDeclaration {
|
||||
NetDeclaration(NetDeclaration),
|
||||
DataDeclaration(DataDeclaration),
|
||||
@ -34,7 +34,7 @@ pub enum PackageOrGenerateItemDeclaration {
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct AnonymousProgram {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -44,7 +44,7 @@ pub struct AnonymousProgram {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum AnonymousProgramItem {
|
||||
TaskDeclaration(TaskDeclaration),
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
|
@ -8,13 +8,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProgramItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortProgramItem(NonPortProgramItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NonPortProgramItem {
|
||||
Assign(NonPortProgramItemAssign),
|
||||
Module(NonPortProgramItemModule),
|
||||
@ -25,12 +25,12 @@ pub enum NonPortProgramItem {
|
||||
ProgramGenerateItem(ProgramGenerateItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortProgramItemAssign {
|
||||
pub nodes: (Vec<AttributeInstance>, ContinuousAssign),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortProgramItemModule {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -38,22 +38,22 @@ pub struct NonPortProgramItemModule {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortProgramItemInitial {
|
||||
pub nodes: (Vec<AttributeInstance>, InitialConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortProgramItemFinal {
|
||||
pub nodes: (Vec<AttributeInstance>, FinalConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NonPortProgramItemAssertion {
|
||||
pub nodes: (Vec<AttributeInstance>, ConcurrentAssertionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProgramGenerateItem {
|
||||
LoopGenerateConstruct(LoopGenerateConstruct),
|
||||
ConditionalGenerateConstruct(ConditionalGenerateConstruct),
|
||||
|
@ -8,12 +8,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SourceText {
|
||||
pub nodes: (Option<TimeunitsDeclaration>, Vec<Description>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum Description {
|
||||
ModuleDeclaration(ModuleDeclaration),
|
||||
UdpDeclaration(UdpDeclaration),
|
||||
@ -25,17 +25,17 @@ pub enum Description {
|
||||
ConfigDeclaration(ConfigDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DescriptionPackageItem {
|
||||
pub nodes: (Vec<AttributeInstance>, PackageItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DescriptionBindDirective {
|
||||
pub nodes: (Vec<AttributeInstance>, BindDirective),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -49,7 +49,7 @@ pub struct ModuleNonansiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -63,7 +63,7 @@ pub struct ModuleAnsiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleDeclaration {
|
||||
Nonansi(ModuleDeclarationNonansi),
|
||||
Ansi(ModuleDeclarationAnsi),
|
||||
@ -72,7 +72,7 @@ pub enum ModuleDeclaration {
|
||||
ExternAnsi(ModuleDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleDeclarationNonansi {
|
||||
pub nodes: (
|
||||
ModuleNonansiHeader,
|
||||
@ -83,7 +83,7 @@ pub struct ModuleDeclarationNonansi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleDeclarationAnsi {
|
||||
pub nodes: (
|
||||
ModuleAnsiHeader,
|
||||
@ -94,7 +94,7 @@ pub struct ModuleDeclarationAnsi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -110,23 +110,23 @@ pub struct ModuleDeclarationWildcard {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, ModuleNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ModuleDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, ModuleAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ModuleKeyword {
|
||||
Module(Keyword),
|
||||
Macromodule(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfaceDeclaration {
|
||||
Nonansi(InterfaceDeclarationNonansi),
|
||||
Ansi(InterfaceDeclarationAnsi),
|
||||
@ -135,7 +135,7 @@ pub enum InterfaceDeclaration {
|
||||
ExternAnsi(InterfaceDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceDeclarationNonansi {
|
||||
pub nodes: (
|
||||
InterfaceNonansiHeader,
|
||||
@ -146,7 +146,7 @@ pub struct InterfaceDeclarationNonansi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceDeclarationAnsi {
|
||||
pub nodes: (
|
||||
InterfaceAnsiHeader,
|
||||
@ -157,7 +157,7 @@ pub struct InterfaceDeclarationAnsi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -173,17 +173,17 @@ pub struct InterfaceDeclarationWildcard {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, InterfaceNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, InterfaceAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -197,7 +197,7 @@ pub struct InterfaceNonansiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -211,7 +211,7 @@ pub struct InterfaceAnsiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ProgramDeclaration {
|
||||
Nonansi(ProgramDeclarationNonansi),
|
||||
Ansi(ProgramDeclarationAnsi),
|
||||
@ -220,7 +220,7 @@ pub enum ProgramDeclaration {
|
||||
ExternAnsi(ProgramDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramDeclarationNonansi {
|
||||
pub nodes: (
|
||||
ProgramNonansiHeader,
|
||||
@ -231,7 +231,7 @@ pub struct ProgramDeclarationNonansi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramDeclarationAnsi {
|
||||
pub nodes: (
|
||||
ProgramAnsiHeader,
|
||||
@ -242,7 +242,7 @@ pub struct ProgramDeclarationAnsi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -257,17 +257,17 @@ pub struct ProgramDeclarationWildcard {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, ProgramNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, ProgramAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -281,7 +281,7 @@ pub struct ProgramNonansiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ProgramAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -295,7 +295,7 @@ pub struct ProgramAnsiHeader {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CheckerDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -308,7 +308,7 @@ pub struct CheckerDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ClassDeclaration {
|
||||
pub nodes: (
|
||||
Option<Virtual>,
|
||||
@ -329,17 +329,17 @@ pub struct ClassDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Virtual {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceClassType {
|
||||
pub nodes: (PsClassIdentifier, Option<ParameterValueAssignment>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceClassDeclaration {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -354,7 +354,7 @@ pub struct InterfaceClassDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InterfaceClassItem {
|
||||
TypeDeclaration(TypeDeclaration),
|
||||
Method(InterfaceClassItemMethod),
|
||||
@ -363,17 +363,17 @@ pub enum InterfaceClassItem {
|
||||
Null(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceClassItemMethod {
|
||||
pub nodes: (Vec<AttributeInstance>, InterfaceClassMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InterfaceClassMethod {
|
||||
pub nodes: (Keyword, Keyword, MethodPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PackageDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -388,7 +388,7 @@ pub struct PackageDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TimeunitsDeclaration {
|
||||
Timeunit(TimeunitsDeclarationTimeunit),
|
||||
Timeprecision(TimeunitsDeclarationTimeprecision),
|
||||
@ -396,7 +396,7 @@ pub enum TimeunitsDeclaration {
|
||||
TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeunit {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -406,12 +406,12 @@ pub struct TimeunitsDeclarationTimeunit {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeprecision {
|
||||
pub nodes: (Keyword, TimeLiteral, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeunitTimeprecision {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -423,7 +423,7 @@ pub struct TimeunitsDeclarationTimeunitTimeprecision {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeprecisionTimeunit {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
|
@ -7,12 +7,12 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecifyBlock {
|
||||
pub nodes: (Keyword, Vec<SpecifyItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SpecifyItem {
|
||||
SpecparamDeclaration(SpecparamDeclaration),
|
||||
PulsestyleDeclaration(PulsestyleDeclaration),
|
||||
@ -21,12 +21,12 @@ pub enum SpecifyItem {
|
||||
SystemTimingCheck(SystemTimingCheck),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PulsestyleDeclaration {
|
||||
pub nodes: (Keyword, ListOfPathOutputs, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ShowcancelledDeclaration {
|
||||
pub nodes: (Keyword, ListOfPathOutputs, Symbol),
|
||||
}
|
||||
|
@ -6,36 +6,36 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecifyInputTerminalDescriptor {
|
||||
pub nodes: (InputIdentifier, Option<Bracket<ConstantRangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SpecifyOutputTerminalDescriptor {
|
||||
pub nodes: (OutputIdentifier, Option<Bracket<ConstantRangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum InputIdentifier {
|
||||
InputPortIdentifier(InputPortIdentifier),
|
||||
InoutPortIdentifier(InoutPortIdentifier),
|
||||
Interface(InputIdentifierInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InputIdentifierInterface {
|
||||
pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum OutputIdentifier {
|
||||
OutputPortIdentifier(OutputPortIdentifier),
|
||||
InoutPortIdentifier(InoutPortIdentifier),
|
||||
Interface(OutputIdentifierInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputIdentifierInterface {
|
||||
pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier),
|
||||
}
|
||||
|
@ -7,30 +7,30 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PathDeclaration {
|
||||
SimplePathDeclaration((SimplePathDeclaration, Symbol)),
|
||||
EdgeSensitivePathDeclaration((EdgeSensitivePathDeclaration, Symbol)),
|
||||
StateDependentPathDeclaration((StateDependentPathDeclaration, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SimplePathDeclaration {
|
||||
Parallel(SimplePathDeclarationParallel),
|
||||
Full(SimplePathDeclarationFull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimplePathDeclarationParallel {
|
||||
pub nodes: (ParallelPathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SimplePathDeclarationFull {
|
||||
pub nodes: (FullPathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParallelPathDescription {
|
||||
pub nodes: (
|
||||
Paren<(
|
||||
@ -42,7 +42,7 @@ pub struct ParallelPathDescription {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FullPathDescription {
|
||||
pub nodes: (
|
||||
Paren<(
|
||||
@ -54,12 +54,12 @@ pub struct FullPathDescription {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPathInputs {
|
||||
pub nodes: (List<Symbol, SpecifyInputTerminalDescriptor>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPathOutputs {
|
||||
pub nodes: (List<Symbol, SpecifyOutputTerminalDescriptor>,),
|
||||
}
|
||||
|
@ -7,48 +7,48 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum PathDelayValue {
|
||||
ListOfPathDelayExpressions(ListOfPathDelayExpressions),
|
||||
Paren(PathDelayValueParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PathDelayValueParen {
|
||||
pub nodes: (Paren<ListOfPathDelayExpressions>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfPathDelayExpressions {
|
||||
pub nodes: (List<Symbol, TPathDelayExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TPathDelayExpression {
|
||||
pub nodes: (PathDelayExpression,),
|
||||
}
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PathDelayExpression {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EdgeSensitivePathDeclaration {
|
||||
Parallel(EdgeSensitivePathDeclarationParallel),
|
||||
Full(EdgeSensitivePathDeclarationFull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeSensitivePathDeclarationParallel {
|
||||
pub nodes: (ParallelEdgeSensitivePathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeSensitivePathDeclarationFull {
|
||||
pub nodes: (FullEdgeSensitivePathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ParallelEdgeSensitivePathDescription {
|
||||
pub nodes: (
|
||||
Paren<(
|
||||
@ -66,7 +66,7 @@ pub struct ParallelEdgeSensitivePathDescription {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FullEdgeSensitivePathDescription {
|
||||
pub nodes: (
|
||||
Paren<(
|
||||
@ -84,31 +84,31 @@ pub struct FullEdgeSensitivePathDescription {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataSourceExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EdgeIdentifier {
|
||||
Posedge(Keyword),
|
||||
Negedge(Keyword),
|
||||
Edge(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum StateDependentPathDeclaration {
|
||||
IfSimple(StateDependentPathDeclarationIfSimple),
|
||||
IfEdgeSensitive(StateDependentPathDeclarationIfEdgeSensitive),
|
||||
IfNone(StateDependentPathDeclarationIfNone),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfSimple {
|
||||
pub nodes: (Keyword, Paren<ModulePathExpression>, SimplePathDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfEdgeSensitive {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -117,12 +117,12 @@ pub struct StateDependentPathDeclarationIfEdgeSensitive {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfNone {
|
||||
pub nodes: (Keyword, SimplePathDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PolarityOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
@ -6,84 +6,84 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimecheckCondition {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ControlledReferenceEvent {
|
||||
pub nodes: (ControlledTimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DataEvent {
|
||||
pub nodes: (TimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DelayedData {
|
||||
TerminalIdentifier(TerminalIdentifier),
|
||||
WithMintypmax(DelayedDataWithMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DelayedDataWithMintypmax {
|
||||
pub nodes: (TerminalIdentifier, Bracket<ConstantMintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum DelayedReference {
|
||||
TerminalIdentifier(TerminalIdentifier),
|
||||
WithMintypmax(DelayedReferenceWithMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct DelayedReferenceWithMintypmax {
|
||||
pub nodes: (TerminalIdentifier, Bracket<ConstantMintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EndEdgeOffset {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EventBasedFlag {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Notifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ReferenceEvent {
|
||||
pub nodes: (TimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RemainActiveFlag {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimestampCondition {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct StartEdgeOffset {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Threshold {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimingCheckLimit {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SystemTimingCheck {
|
||||
SetupTimingCheck(SetupTimingCheck),
|
||||
HoldTimingCheck(HoldTimingCheck),
|
||||
@ -23,7 +23,7 @@ pub enum SystemTimingCheck {
|
||||
NochargeTimingCheck(NochargeTimingCheck),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SetupTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -39,7 +39,7 @@ pub struct SetupTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct HoldTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -55,7 +55,7 @@ pub struct HoldTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SetupholdTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -89,7 +89,7 @@ pub struct SetupholdTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RecoveryTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -105,7 +105,7 @@ pub struct RecoveryTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RemovalTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -121,7 +121,7 @@ pub struct RemovalTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct RecremTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -155,7 +155,7 @@ pub struct RecremTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SkewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -171,7 +171,7 @@ pub struct SkewTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimeskewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -195,7 +195,7 @@ pub struct TimeskewTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct FullskewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -221,7 +221,7 @@ pub struct FullskewTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PeriodTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -235,7 +235,7 @@ pub struct PeriodTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct WidthTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -251,7 +251,7 @@ pub struct WidthTimingCheck {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NochargeTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimingCheckEvent {
|
||||
pub nodes: (
|
||||
Option<TimingCheckEventControl>,
|
||||
@ -16,7 +16,7 @@ pub struct TimingCheckEvent {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ControlledTimingCheckEvent {
|
||||
pub nodes: (
|
||||
TimingCheckEventControl,
|
||||
@ -25,7 +25,7 @@ pub struct ControlledTimingCheckEvent {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TimingCheckEventControl {
|
||||
Posedge(Keyword),
|
||||
Negedge(Keyword),
|
||||
@ -33,51 +33,51 @@ pub enum TimingCheckEventControl {
|
||||
EdgeControlSpecifier(EdgeControlSpecifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SpecifyTerminalDescriptor {
|
||||
SpecifyInputTerminalDescriptor(SpecifyInputTerminalDescriptor),
|
||||
SpecifyOutputTerminalDescriptor(SpecifyOutputTerminalDescriptor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeControlSpecifier {
|
||||
pub nodes: (Keyword, Bracket<List<Symbol, EdgeDescriptor>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeDescriptor {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum TimingCheckCondition {
|
||||
ScalarTimingCheckCondition(ScalarTimingCheckCondition),
|
||||
Paren(TimingCheckConditionParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct TimingCheckConditionParen {
|
||||
pub nodes: (Paren<ScalarTimingCheckCondition>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum ScalarTimingCheckCondition {
|
||||
Expression(Expression),
|
||||
Unary(ScalarTimingCheckConditionUnary),
|
||||
Binary(ScalarTimingCheckConditionBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ScalarTimingCheckConditionUnary {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ScalarTimingCheckConditionBinary {
|
||||
pub nodes: (Expression, Symbol, ScalarConstant),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ScalarConstant {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
@ -8,13 +8,13 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UdpBody {
|
||||
CombinationalBody(CombinationalBody),
|
||||
SequentialBody(SequentialBody),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CombinationalBody {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
@ -24,12 +24,12 @@ pub struct CombinationalBody {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CombinationalEntry {
|
||||
pub nodes: (LevelInputList, Symbol, OutputSymbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequentialBody {
|
||||
pub nodes: (
|
||||
Option<UdpInitialStatement>,
|
||||
@ -40,17 +40,17 @@ pub struct SequentialBody {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpInitialStatement {
|
||||
pub nodes: (Keyword, OutputPortIdentifier, Symbol, InitVal, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct InitVal {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequentialEntry {
|
||||
pub nodes: (
|
||||
SeqInputList,
|
||||
@ -62,55 +62,55 @@ pub struct SequentialEntry {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum SeqInputList {
|
||||
LevelInputList(LevelInputList),
|
||||
EdgeInputList(EdgeInputList),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LevelInputList {
|
||||
pub nodes: (LevelSymbol, Vec<LevelSymbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeInputList {
|
||||
pub nodes: (Vec<LevelSymbol>, EdgeIndicator, Vec<LevelSymbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum EdgeIndicator {
|
||||
Paren(EdgeIndicatorParen),
|
||||
EdgeSymbol(EdgeSymbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeIndicatorParen {
|
||||
pub nodes: (Paren<(LevelSymbol, LevelSymbol)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CurrentState {
|
||||
pub nodes: (LevelSymbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum NextState {
|
||||
OutputSymbol(OutputSymbol),
|
||||
Minus(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LevelSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpNonansiDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -19,7 +19,7 @@ pub struct UdpNonansiDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpAnsiDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -30,7 +30,7 @@ pub struct UdpAnsiDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UdpDeclaration {
|
||||
Nonansi(UdpDeclarationNonansi),
|
||||
Ansi(UdpDeclarationAnsi),
|
||||
@ -39,7 +39,7 @@ pub enum UdpDeclaration {
|
||||
Wildcard(UdpDeclarationWildcard),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationNonansi {
|
||||
pub nodes: (
|
||||
UdpNonansiDeclaration,
|
||||
@ -51,7 +51,7 @@ pub struct UdpDeclarationNonansi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationAnsi {
|
||||
pub nodes: (
|
||||
UdpAnsiDeclaration,
|
||||
@ -61,17 +61,17 @@ pub struct UdpDeclarationAnsi {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, UdpNonansiDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, UdpAnsiDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
|
@ -7,7 +7,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpInstantiation {
|
||||
pub nodes: (
|
||||
UdpIdentifier,
|
||||
@ -18,7 +18,7 @@ pub struct UdpInstantiation {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance>,
|
||||
|
@ -8,7 +8,7 @@ use nom::IResult;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpPortList {
|
||||
pub nodes: (
|
||||
OutputPortIdentifier,
|
||||
@ -17,7 +17,7 @@ pub struct UdpPortList {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpDeclarationPortList {
|
||||
pub nodes: (
|
||||
UdpOutputDeclaration,
|
||||
@ -26,25 +26,25 @@ pub struct UdpDeclarationPortList {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UdpPortDeclaration {
|
||||
UdpOutputDeclaration((UdpOutputDeclaration, Symbol)),
|
||||
UdpInputDeclaration((UdpInputDeclaration, Symbol)),
|
||||
UdpRegDeclaration((UdpRegDeclaration, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum UdpOutputDeclaration {
|
||||
Nonreg(UdpOutputDeclarationNonreg),
|
||||
Reg(UdpOutputDeclarationReg),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpOutputDeclarationNonreg {
|
||||
pub nodes: (Vec<AttributeInstance>, Keyword, PortIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpOutputDeclarationReg {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -55,7 +55,7 @@ pub struct UdpOutputDeclarationReg {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpInputDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
@ -64,7 +64,7 @@ pub struct UdpInputDeclaration {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct UdpRegDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance>,
|
||||
|
@ -261,43 +261,43 @@ const KEYWORDS: &[&str] = &[
|
||||
"xor",
|
||||
];
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Symbol {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct Keyword {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub enum WhiteSpace {
|
||||
Space(Locate),
|
||||
Comment(Comment),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Paren<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Brace<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Bracket<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ApostropheBrace<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct List<T, U> {
|
||||
pub nodes: (U, Vec<(T, U)>),
|
||||
}
|
||||
|
@ -53,23 +53,29 @@ fn impl_node(ast: &DeriveInput) -> TokenStream {
|
||||
|
||||
let gen = quote! {
|
||||
impl<'a> Node<'a> for #name {
|
||||
fn next(&'a self) -> AnyNodes<'a> {
|
||||
fn next(&'a self) -> RefNodes<'a> {
|
||||
#next
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a #name> for AnyNodes<'a> {
|
||||
impl<'a> From<&'a #name> for RefNodes<'a> {
|
||||
fn from(x: &'a #name) -> Self {
|
||||
vec![AnyNode::#name(x)].into()
|
||||
vec![RefNode::#name(x)].into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<#name> for AnyNode {
|
||||
fn from(x: #name) -> Self {
|
||||
AnyNode::#name(x)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a #name {
|
||||
type Item = AnyNode<'a>;
|
||||
type Item = RefNode<'a>;
|
||||
type IntoIter = Iter<'a>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
let nodes: AnyNodes = self.into();
|
||||
let nodes: RefNodes = self.into();
|
||||
Iter { next: nodes }
|
||||
}
|
||||
}
|
||||
@ -93,7 +99,45 @@ fn impl_any_node(ast: &DeriveInput) -> TokenStream {
|
||||
for v in &data.variants {
|
||||
let ident = &v.ident;
|
||||
let item = quote! {
|
||||
AnyNode::#ident(x) => x.next(),
|
||||
impl TryFrom<AnyNode> for #ident {
|
||||
type Error = ();
|
||||
fn try_from(x: AnyNode) -> Result<Self, Self::Error> {
|
||||
match x {
|
||||
AnyNode::#ident(x) => Ok(x),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
items = quote! {
|
||||
#items
|
||||
#item
|
||||
};
|
||||
}
|
||||
|
||||
let gen = quote! {
|
||||
#items
|
||||
};
|
||||
gen.into()
|
||||
}
|
||||
|
||||
#[proc_macro_derive(RefNode)]
|
||||
pub fn ref_node_derive(input: TokenStream) -> TokenStream {
|
||||
let ast = syn::parse(input).unwrap();
|
||||
impl_ref_node(&ast)
|
||||
}
|
||||
|
||||
fn impl_ref_node(ast: &DeriveInput) -> TokenStream {
|
||||
let ref data = match ast.data {
|
||||
Enum(ref data) => data,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let mut items = quote! {};
|
||||
for v in &data.variants {
|
||||
let ident = &v.ident;
|
||||
let item = quote! {
|
||||
RefNode::#ident(x) => x.next(),
|
||||
};
|
||||
items = quote! {
|
||||
#items
|
||||
@ -104,7 +148,7 @@ fn impl_any_node(ast: &DeriveInput) -> TokenStream {
|
||||
let name = &ast.ident;
|
||||
let gen = quote! {
|
||||
impl<'a> #name<'a> {
|
||||
fn next(&self) -> AnyNodes<'a> {
|
||||
fn next(&self) -> RefNodes<'a> {
|
||||
match self {
|
||||
#items
|
||||
}
|
||||
@ -122,7 +166,7 @@ pub fn parser(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
fn impl_parser(attr: &AttributeArgs, item: &ItemFn) -> TokenStream {
|
||||
let (maybe_recursive, ambiguous, memoize) = impl_parser_attribute(attr);
|
||||
let (maybe_recursive, ambiguous) = impl_parser_attribute(attr);
|
||||
|
||||
let trace = impl_parser_trace(&item);
|
||||
let trace = parse_macro_input!(trace as Stmt);
|
||||
@ -147,27 +191,15 @@ fn impl_parser(attr: &AttributeArgs, item: &ItemFn) -> TokenStream {
|
||||
let clear_recursive_flags = parse_macro_input!(clear_recursive_flags as Expr);
|
||||
let clear_recursive_flags = Stmt::Expr(clear_recursive_flags);
|
||||
|
||||
let check_failed_memo = impl_parser_check_failed_memo(&item);
|
||||
let check_failed_memo = parse_macro_input!(check_failed_memo as Stmt);
|
||||
|
||||
let set_failed_memo = impl_parser_set_failed_memo(&item);
|
||||
let set_failed_memo = parse_macro_input!(set_failed_memo as Stmt);
|
||||
|
||||
let mut item = item.clone();
|
||||
|
||||
item.block.stmts.clear();
|
||||
item.block.stmts.push(trace);
|
||||
if memoize {
|
||||
item.block.stmts.push(check_failed_memo);
|
||||
}
|
||||
if maybe_recursive {
|
||||
item.block.stmts.push(check_recursive_flag);
|
||||
item.block.stmts.push(set_recursive_flag);
|
||||
}
|
||||
item.block.stmts.push(body);
|
||||
if memoize {
|
||||
item.block.stmts.push(set_failed_memo);
|
||||
}
|
||||
item.block.stmts.push(body_unwrap);
|
||||
item.block.stmts.push(clear_recursive_flags);
|
||||
|
||||
@ -177,21 +209,19 @@ fn impl_parser(attr: &AttributeArgs, item: &ItemFn) -> TokenStream {
|
||||
gen.into()
|
||||
}
|
||||
|
||||
fn impl_parser_attribute(attr: &AttributeArgs) -> (bool, bool, bool) {
|
||||
fn impl_parser_attribute(attr: &AttributeArgs) -> (bool, bool) {
|
||||
let mut maybe_recursive = false;
|
||||
let mut ambiguous = false;
|
||||
let mut memoize = false;
|
||||
|
||||
for a in attr {
|
||||
match a {
|
||||
NestedMeta::Meta(Meta::Word(x)) if x == "MaybeRecursive" => maybe_recursive = true,
|
||||
NestedMeta::Meta(Meta::Word(x)) if x == "Ambiguous" => ambiguous = true,
|
||||
NestedMeta::Meta(Meta::Word(x)) if x == "Memoize" => memoize = true,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
(maybe_recursive, ambiguous, memoize)
|
||||
(maybe_recursive, ambiguous)
|
||||
}
|
||||
|
||||
fn impl_parser_trace(item: &ItemFn) -> TokenStream {
|
||||
@ -325,51 +355,3 @@ fn impl_parser_clear_recursive_flags(_item: &ItemFn) -> TokenStream {
|
||||
};
|
||||
gen.into()
|
||||
}
|
||||
|
||||
fn impl_parser_check_failed_memo(item: &ItemFn) -> TokenStream {
|
||||
let ident = &item.ident;
|
||||
|
||||
let gen = quote! {
|
||||
let offset = {
|
||||
//if thread_context::FAILED_MEMO.with(|m| { m.borrow().get(&(stringify!(#ident), s.offset)).is_some() }) {
|
||||
// #[cfg(feature = "trace")]
|
||||
// println!("{:<128} : memoized failure", format!("{}{}", " ".repeat(s.extra.depth), stringify!(#ident)));
|
||||
// return Err(nom::Err::Error(nom::error::make_error(s, nom::error::ErrorKind::Fix)));
|
||||
//}
|
||||
if let Some(x) = thread_context::FAILED_MEMO.with(|m| { if let Some(x) = m.borrow().get(&(stringify!(#ident), s.offset)) { Some(*x) } else { None } }) {
|
||||
if x {
|
||||
#[cfg(feature = "trace")]
|
||||
println!("{:<128} : memoized failure", format!("{}{}", " ".repeat(s.extra.depth), stringify!(#ident)));
|
||||
return Err(nom::Err::Error(nom::error::make_error(s, nom::error::ErrorKind::Fix)));
|
||||
} else {
|
||||
#[cfg(feature = "trace")]
|
||||
println!("{:<128} : memoized success", format!("{}{}", " ".repeat(s.extra.depth), stringify!(#ident)));
|
||||
}
|
||||
}
|
||||
s.offset
|
||||
};
|
||||
};
|
||||
gen.into()
|
||||
}
|
||||
|
||||
fn impl_parser_set_failed_memo(item: &ItemFn) -> TokenStream {
|
||||
let ident = &item.ident;
|
||||
|
||||
let gen = quote! {
|
||||
//if body_ret.is_err() {
|
||||
// thread_context::FAILED_MEMO.with(|m| {
|
||||
// m.borrow_mut().insert((stringify!(#ident), offset), ());
|
||||
// })
|
||||
//}
|
||||
if body_ret.is_err() {
|
||||
thread_context::FAILED_MEMO.with(|m| {
|
||||
m.borrow_mut().insert((stringify!(#ident), offset), true);
|
||||
})
|
||||
} else {
|
||||
thread_context::FAILED_MEMO.with(|m| {
|
||||
m.borrow_mut().insert((stringify!(#ident), offset), false);
|
||||
})
|
||||
}
|
||||
};
|
||||
gen.into()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user