Change Span to Locate
This commit is contained in:
parent
567eb87bf6
commit
81e5a8b976
4
build.rs
4
build.rs
@ -12,7 +12,7 @@ fn main() {
|
||||
|
||||
let _ = write!(out, "#[derive(Debug, Clone, AnyNode)]\n");
|
||||
let _ = write!(out, "pub enum AnyNode<'a> {{\n");
|
||||
let _ = write!(out, " Span(&'a Span<'a>),\n");
|
||||
let _ = write!(out, " Locate(&'a Locate),\n");
|
||||
|
||||
let re_node = Regex::new(r"#\[derive.*Node.*\]").unwrap();
|
||||
|
||||
@ -26,7 +26,7 @@ fn main() {
|
||||
let line = line.unwrap();
|
||||
if hit_node {
|
||||
let name = line.split_whitespace().nth(2).unwrap().replace("<'a>", "");
|
||||
let _ = write!(out, " {}(&'a {}<'a>),\n", name, name);
|
||||
let _ = write!(out, " {}(&'a {}),\n", name, name);
|
||||
hit_node = false;
|
||||
}
|
||||
if re_node.is_match(&line) {
|
||||
|
@ -35,9 +35,9 @@ impl<'a> From<Vec<AnyNode<'a>>> for AnyNodes<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Span<'a>> for AnyNodes<'a> {
|
||||
fn from(x: &'a Span<'a>) -> Self {
|
||||
vec![AnyNode::Span(x)].into()
|
||||
impl<'a> From<&'a Locate> for AnyNodes<'a> {
|
||||
fn from(x: &'a Locate) -> Self {
|
||||
vec![AnyNode::Locate(x)].into()
|
||||
}
|
||||
}
|
||||
|
||||
@ -327,11 +327,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Paren<'a, T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Paren<T>> for AnyNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Paren<'a, T>) -> Self {
|
||||
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();
|
||||
@ -343,11 +343,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Brace<'a, T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Brace<T>> for AnyNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Brace<'a, T>) -> Self {
|
||||
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();
|
||||
@ -359,11 +359,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Bracket<'a, T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a Bracket<T>> for AnyNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a Bracket<'a, T>) -> Self {
|
||||
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();
|
||||
@ -375,11 +375,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a ApostropheBrace<'a, T>> for AnyNodes<'a>
|
||||
impl<'a, T> From<&'a ApostropheBrace<T>> for AnyNodes<'a>
|
||||
where
|
||||
&'a T: Into<AnyNodes<'a>>,
|
||||
{
|
||||
fn from(x: &'a ApostropheBrace<'a, T>) -> Self {
|
||||
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();
|
||||
|
@ -5,7 +5,7 @@ pub trait Node<'a> {
|
||||
fn next(&'a self) -> AnyNodes<'a>;
|
||||
}
|
||||
|
||||
impl<'a> Node<'a> for Span<'a> {
|
||||
impl<'a> Node<'a> for Locate {
|
||||
fn next(&'a self) -> AnyNodes<'a> {
|
||||
vec![].into()
|
||||
}
|
||||
|
@ -32,6 +32,23 @@ pub struct Extra {
|
||||
|
||||
pub type Span<'a> = nom_locate::LocatedSpanEx<&'a str, Extra>;
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, PartialEq)]
|
||||
pub struct Locate {
|
||||
offset: usize,
|
||||
line: u32,
|
||||
len: usize,
|
||||
}
|
||||
|
||||
impl<'a> From<Span<'a>> for Locate {
|
||||
fn from(x: Span<'a>) -> Self {
|
||||
Locate {
|
||||
offset: x.offset,
|
||||
line: x.line,
|
||||
len: x.fragment.len(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod thread_context {
|
||||
|
||||
use crate::parser::RECURSIVE_FLAG_WORDS;
|
||||
@ -75,4 +92,10 @@ mod thread_context {
|
||||
RefCell::new(HashMap::new())
|
||||
}
|
||||
);
|
||||
|
||||
//thread_local!(
|
||||
// pub static MEMO: RefCell<HashMap<(&'static str, usize), AnyNode>> = {
|
||||
// RefCell::new(HashMap::new())
|
||||
// }
|
||||
//);
|
||||
}
|
||||
|
@ -8,95 +8,80 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssertionItem<'a> {
|
||||
Concurrent(ConcurrentAssertionItem<'a>),
|
||||
Immediate(DeferredImmediateAssetionItem<'a>),
|
||||
pub enum AssertionItem {
|
||||
Concurrent(ConcurrentAssertionItem),
|
||||
Immediate(DeferredImmediateAssetionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DeferredImmediateAssetionItem<'a> {
|
||||
pub struct DeferredImmediateAssetionItem {
|
||||
pub nodes: (
|
||||
Option<(BlockIdentifier<'a>, Symbol<'a>)>,
|
||||
DeferredImmediateAssertionStatement<'a>,
|
||||
Option<(BlockIdentifier, Symbol)>,
|
||||
DeferredImmediateAssertionStatement,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProceduralAssertionStatement<'a> {
|
||||
Concurrent(ConcurrentAssertionStatement<'a>),
|
||||
Immediate(ImmediateAssetionStatement<'a>),
|
||||
Checker(CheckerInstantiation<'a>),
|
||||
pub enum ProceduralAssertionStatement {
|
||||
Concurrent(ConcurrentAssertionStatement),
|
||||
Immediate(ImmediateAssetionStatement),
|
||||
Checker(CheckerInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImmediateAssetionStatement<'a> {
|
||||
Simple(SimpleImmediateAssertionStatement<'a>),
|
||||
Deferred(DeferredImmediateAssertionStatement<'a>),
|
||||
pub enum ImmediateAssetionStatement {
|
||||
Simple(SimpleImmediateAssertionStatement),
|
||||
Deferred(DeferredImmediateAssertionStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SimpleImmediateAssertionStatement<'a> {
|
||||
Assert(SimpleImmediateAssertStatement<'a>),
|
||||
Assume(SimpleImmediateAssumeStatement<'a>),
|
||||
Cover(SimpleImmediateCoverStatement<'a>),
|
||||
pub enum SimpleImmediateAssertionStatement {
|
||||
Assert(SimpleImmediateAssertStatement),
|
||||
Assume(SimpleImmediateAssumeStatement),
|
||||
Cover(SimpleImmediateCoverStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimpleImmediateAssertStatement<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>),
|
||||
pub struct SimpleImmediateAssertStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimpleImmediateAssumeStatement<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>),
|
||||
pub struct SimpleImmediateAssumeStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimpleImmediateCoverStatement<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
|
||||
pub struct SimpleImmediateCoverStatement {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DeferredImmediateAssertionStatement<'a> {
|
||||
Assert(DeferredImmediateAssertStatement<'a>),
|
||||
Assume(DeferredImmediateAssumeStatement<'a>),
|
||||
Cover(DeferredImmediateCoverStatement<'a>),
|
||||
pub enum DeferredImmediateAssertionStatement {
|
||||
Assert(DeferredImmediateAssertStatement),
|
||||
Assume(DeferredImmediateAssumeStatement),
|
||||
Cover(DeferredImmediateCoverStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DeferredImmediateAssertStatement<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
AssertTiming<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
ActionBlock<'a>,
|
||||
),
|
||||
pub struct DeferredImmediateAssertStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DeferredImmediateAssumeStatement<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
AssertTiming<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
ActionBlock<'a>,
|
||||
),
|
||||
pub struct DeferredImmediateAssumeStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, ActionBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DeferredImmediateCoverStatement<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
AssertTiming<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
StatementOrNull<'a>,
|
||||
),
|
||||
pub struct DeferredImmediateCoverStatement {
|
||||
pub nodes: (Keyword, AssertTiming, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssertTiming<'a> {
|
||||
Zero(Symbol<'a>),
|
||||
Final(Keyword<'a>),
|
||||
pub enum AssertTiming {
|
||||
Zero(Symbol),
|
||||
Final(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,137 +9,128 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CaseStatement<'a> {
|
||||
Normal(CaseStatementNormal<'a>),
|
||||
Matches(CaseStatementMatches<'a>),
|
||||
Inside(CaseStatementInside<'a>),
|
||||
pub enum CaseStatement {
|
||||
Normal(CaseStatementNormal),
|
||||
Matches(CaseStatementMatches),
|
||||
Inside(CaseStatementInside),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseStatementNormal<'a> {
|
||||
pub struct CaseStatementNormal {
|
||||
pub nodes: (
|
||||
Option<UniquePriority<'a>>,
|
||||
CaseKeyword<'a>,
|
||||
Paren<'a, CaseExpression<'a>>,
|
||||
CaseItem<'a>,
|
||||
Vec<CaseItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<UniquePriority>,
|
||||
CaseKeyword,
|
||||
Paren<CaseExpression>,
|
||||
CaseItem,
|
||||
Vec<CaseItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseStatementMatches<'a> {
|
||||
pub struct CaseStatementMatches {
|
||||
pub nodes: (
|
||||
Option<UniquePriority<'a>>,
|
||||
CaseKeyword<'a>,
|
||||
Paren<'a, CaseExpression<'a>>,
|
||||
Keyword<'a>,
|
||||
CasePatternItem<'a>,
|
||||
Vec<CasePatternItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<UniquePriority>,
|
||||
CaseKeyword,
|
||||
Paren<CaseExpression>,
|
||||
Keyword,
|
||||
CasePatternItem,
|
||||
Vec<CasePatternItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseStatementInside<'a> {
|
||||
pub struct CaseStatementInside {
|
||||
pub nodes: (
|
||||
Option<UniquePriority<'a>>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, CaseExpression<'a>>,
|
||||
Keyword<'a>,
|
||||
CaseInsideItem<'a>,
|
||||
Vec<CaseInsideItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<UniquePriority>,
|
||||
Keyword,
|
||||
Paren<CaseExpression>,
|
||||
Keyword,
|
||||
CaseInsideItem,
|
||||
Vec<CaseInsideItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CaseKeyword<'a> {
|
||||
Case(Keyword<'a>),
|
||||
Casez(Keyword<'a>),
|
||||
Casex(Keyword<'a>),
|
||||
pub enum CaseKeyword {
|
||||
Case(Keyword),
|
||||
Casez(Keyword),
|
||||
Casex(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseExpression<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct CaseExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CaseItem<'a> {
|
||||
NonDefault(CaseItemNondefault<'a>),
|
||||
Default(CaseItemDefault<'a>),
|
||||
pub enum CaseItem {
|
||||
NonDefault(CaseItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseItemNondefault<'a> {
|
||||
pub struct CaseItemNondefault {
|
||||
pub nodes: (List<Symbol, CaseItemExpression>, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CasePatternItem {
|
||||
NonDefault(CasePatternItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CasePatternItemNondefault {
|
||||
pub nodes: (
|
||||
List<Symbol<'a>, CaseItemExpression<'a>>,
|
||||
Symbol<'a>,
|
||||
StatementOrNull<'a>,
|
||||
Pattern,
|
||||
Option<(Symbol, Expression)>,
|
||||
Symbol,
|
||||
StatementOrNull,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseItemDefault<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<Symbol<'a>>, StatementOrNull<'a>),
|
||||
pub enum CaseInsideItem {
|
||||
NonDefault(CaseInsideItemNondefault),
|
||||
Default(CaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CasePatternItem<'a> {
|
||||
NonDefault(CasePatternItemNondefault<'a>),
|
||||
Default(CaseItemDefault<'a>),
|
||||
pub struct CaseInsideItemNondefault {
|
||||
pub nodes: (OpenRangeList, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CasePatternItemNondefault<'a> {
|
||||
pub nodes: (
|
||||
Pattern<'a>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
Symbol<'a>,
|
||||
StatementOrNull<'a>,
|
||||
),
|
||||
pub struct CaseItemExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CaseInsideItem<'a> {
|
||||
NonDefault(CaseInsideItemNondefault<'a>),
|
||||
Default(CaseItemDefault<'a>),
|
||||
pub struct RandcaseStatement {
|
||||
pub nodes: (Keyword, RandcaseItem, Vec<RandcaseItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseInsideItemNondefault<'a> {
|
||||
pub nodes: (OpenRangeList<'a>, Symbol<'a>, StatementOrNull<'a>),
|
||||
pub struct RandcaseItem {
|
||||
pub nodes: (Expression, Symbol, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseItemExpression<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct OpenRangeList {
|
||||
pub nodes: (List<Symbol, OpenValueRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RandcaseStatement<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
RandcaseItem<'a>,
|
||||
Vec<RandcaseItem<'a>>,
|
||||
Keyword<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RandcaseItem<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, StatementOrNull<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OpenRangeList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, OpenValueRange<'a>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OpenValueRange<'a> {
|
||||
pub nodes: (ValueRange<'a>,),
|
||||
pub struct OpenValueRange {
|
||||
pub nodes: (ValueRange,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,196 +9,182 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClockingDeclaration<'a> {
|
||||
Local(ClockingDeclarationLocal<'a>),
|
||||
Global(ClockingDeclarationGlobal<'a>),
|
||||
pub enum ClockingDeclaration {
|
||||
Local(ClockingDeclarationLocal),
|
||||
Global(ClockingDeclarationGlobal),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDeclarationLocal<'a> {
|
||||
pub struct ClockingDeclarationLocal {
|
||||
pub nodes: (
|
||||
Option<Default<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<ClockingIdentifier<'a>>,
|
||||
ClockingEvent<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<ClockingItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ClockingIdentifier<'a>)>,
|
||||
Option<Default>,
|
||||
Keyword,
|
||||
Option<ClockingIdentifier>,
|
||||
ClockingEvent,
|
||||
Symbol,
|
||||
Vec<ClockingItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ClockingIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Default<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Default {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDeclarationGlobal<'a> {
|
||||
pub struct ClockingDeclarationGlobal {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Option<ClockingIdentifier<'a>>,
|
||||
ClockingEvent<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ClockingIdentifier<'a>)>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Option<ClockingIdentifier>,
|
||||
ClockingEvent,
|
||||
Symbol,
|
||||
Keyword,
|
||||
Option<(Symbol, ClockingIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClockingEvent<'a> {
|
||||
Identifier(ClockingEventIdentifier<'a>),
|
||||
Expression(ClockingEventExpression<'a>),
|
||||
pub enum ClockingEvent {
|
||||
Identifier(ClockingEventIdentifier),
|
||||
Expression(ClockingEventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingEventIdentifier<'a> {
|
||||
pub nodes: (Symbol<'a>, Identifier<'a>),
|
||||
pub struct ClockingEventIdentifier {
|
||||
pub nodes: (Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingEventExpression<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>),
|
||||
pub struct ClockingEventExpression {
|
||||
pub nodes: (Symbol, Paren<EventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClockingItem<'a> {
|
||||
Default(ClockingItemDefault<'a>),
|
||||
Direction(ClockingItemDirection<'a>),
|
||||
Assertion(ClockingItemAssertion<'a>),
|
||||
pub enum ClockingItem {
|
||||
Default(ClockingItemDefault),
|
||||
Direction(ClockingItemDirection),
|
||||
Assertion(ClockingItemAssertion),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingItemDefault<'a> {
|
||||
pub nodes: (Keyword<'a>, DefaultSkew<'a>, Symbol<'a>),
|
||||
pub struct ClockingItemDefault {
|
||||
pub nodes: (Keyword, DefaultSkew, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingItemDirection<'a> {
|
||||
pub nodes: (
|
||||
ClockingDirection<'a>,
|
||||
ListOfClockingDeclAssign<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
pub struct ClockingItemDirection {
|
||||
pub nodes: (ClockingDirection, ListOfClockingDeclAssign, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingItemAssertion<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, AssertionItemDeclaration<'a>),
|
||||
pub struct ClockingItemAssertion {
|
||||
pub nodes: (Vec<AttributeInstance>, AssertionItemDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DefaultSkew<'a> {
|
||||
Input(DefaultSkewInput<'a>),
|
||||
Output(DefaultSkewOutput<'a>),
|
||||
InputOutput(DefaultSkewInputOutput<'a>),
|
||||
pub enum DefaultSkew {
|
||||
Input(DefaultSkewInput),
|
||||
Output(DefaultSkewOutput),
|
||||
InputOutput(DefaultSkewInputOutput),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DefaultSkewInput<'a> {
|
||||
pub nodes: (Keyword<'a>, ClockingSkew<'a>),
|
||||
pub struct DefaultSkewInput {
|
||||
pub nodes: (Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DefaultSkewOutput<'a> {
|
||||
pub nodes: (Keyword<'a>, ClockingSkew<'a>),
|
||||
pub struct DefaultSkewOutput {
|
||||
pub nodes: (Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DefaultSkewInputOutput<'a> {
|
||||
pub nodes: (Keyword<'a>, ClockingSkew<'a>, Keyword<'a>, ClockingSkew<'a>),
|
||||
pub struct DefaultSkewInputOutput {
|
||||
pub nodes: (Keyword, ClockingSkew, Keyword, ClockingSkew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClockingDirection<'a> {
|
||||
Input(ClockingDirectionInput<'a>),
|
||||
Output(ClockingDirectionOutput<'a>),
|
||||
InputOutput(ClockingDirectionInputOutput<'a>),
|
||||
Inout(Keyword<'a>),
|
||||
pub enum ClockingDirection {
|
||||
Input(ClockingDirectionInput),
|
||||
Output(ClockingDirectionOutput),
|
||||
InputOutput(ClockingDirectionInputOutput),
|
||||
Inout(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDirectionInput<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<ClockingSkew<'a>>),
|
||||
pub struct ClockingDirectionInput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDirectionOutput<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<ClockingSkew<'a>>),
|
||||
pub struct ClockingDirectionOutput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDirectionInputOutput<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<ClockingSkew<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<ClockingSkew<'a>>,
|
||||
),
|
||||
pub struct ClockingDirectionInputOutput {
|
||||
pub nodes: (Keyword, Option<ClockingSkew>, Keyword, Option<ClockingSkew>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfClockingDeclAssign<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ClockingDeclAssign<'a>>,),
|
||||
pub struct ListOfClockingDeclAssign {
|
||||
pub nodes: (List<Symbol, ClockingDeclAssign>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDeclAssign<'a> {
|
||||
pub nodes: (SignalIdentifier<'a>, Option<(Symbol<'a>, Expression<'a>)>),
|
||||
pub struct ClockingDeclAssign {
|
||||
pub nodes: (SignalIdentifier, Option<(Symbol, Expression)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClockingSkew<'a> {
|
||||
Edge(ClockingSkewEdge<'a>),
|
||||
DelayControl(DelayControl<'a>),
|
||||
pub enum ClockingSkew {
|
||||
Edge(ClockingSkewEdge),
|
||||
DelayControl(DelayControl),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingSkewEdge<'a> {
|
||||
pub nodes: (EdgeIdentifier<'a>, Option<DelayControl<'a>>),
|
||||
pub struct ClockingSkewEdge {
|
||||
pub nodes: (EdgeIdentifier, Option<DelayControl>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingDrive<'a> {
|
||||
pub nodes: (
|
||||
ClockvarExpression<'a>,
|
||||
Symbol<'a>,
|
||||
Option<CycleDelay<'a>>,
|
||||
Expression<'a>,
|
||||
),
|
||||
pub struct ClockingDrive {
|
||||
pub nodes: (ClockvarExpression, Symbol, Option<CycleDelay>, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CycleDelay<'a> {
|
||||
Integral(CycleDelayIntegral<'a>),
|
||||
Identifier(CycleDelayIdentifier<'a>),
|
||||
Expression(CycleDelayExpression<'a>),
|
||||
pub enum CycleDelay {
|
||||
Integral(CycleDelayIntegral),
|
||||
Identifier(CycleDelayIdentifier),
|
||||
Expression(CycleDelayExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CycleDelayIntegral<'a> {
|
||||
pub nodes: (Symbol<'a>, IntegralNumber<'a>),
|
||||
pub struct CycleDelayIntegral {
|
||||
pub nodes: (Symbol, IntegralNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CycleDelayIdentifier<'a> {
|
||||
pub nodes: (Symbol<'a>, Identifier<'a>),
|
||||
pub struct CycleDelayIdentifier {
|
||||
pub nodes: (Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CycleDelayExpression<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>),
|
||||
pub struct CycleDelayExpression {
|
||||
pub nodes: (Symbol, Paren<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Clockvar<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct Clockvar {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockvarExpression<'a> {
|
||||
pub nodes: (Clockvar<'a>, Select<'a>),
|
||||
pub struct ClockvarExpression {
|
||||
pub nodes: (Clockvar, Select),
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
@ -9,43 +9,38 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConditionalStatement<'a> {
|
||||
pub struct ConditionalStatement {
|
||||
pub nodes: (
|
||||
Option<UniquePriority<'a>>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, CondPredicate<'a>>,
|
||||
StatementOrNull<'a>,
|
||||
Vec<(
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, CondPredicate<'a>>,
|
||||
StatementOrNull<'a>,
|
||||
)>,
|
||||
Option<(Keyword<'a>, StatementOrNull<'a>)>,
|
||||
Option<UniquePriority>,
|
||||
Keyword,
|
||||
Paren<CondPredicate>,
|
||||
StatementOrNull,
|
||||
Vec<(Keyword, Keyword, Paren<CondPredicate>, StatementOrNull)>,
|
||||
Option<(Keyword, StatementOrNull)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UniquePriority<'a> {
|
||||
Unique(Keyword<'a>),
|
||||
Unique0(Keyword<'a>),
|
||||
Priority(Keyword<'a>),
|
||||
pub enum UniquePriority {
|
||||
Unique(Keyword),
|
||||
Unique0(Keyword),
|
||||
Priority(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CondPredicate<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ExpressionOrCondPattern<'a>>,),
|
||||
pub struct CondPredicate {
|
||||
pub nodes: (List<Symbol, ExpressionOrCondPattern>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ExpressionOrCondPattern<'a> {
|
||||
Expression(Expression<'a>),
|
||||
CondPattern(CondPattern<'a>),
|
||||
pub enum ExpressionOrCondPattern {
|
||||
Expression(Expression),
|
||||
CondPattern(CondPattern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CondPattern<'a> {
|
||||
pub nodes: (Expression<'a>, Keyword<'a>, Pattern<'a>),
|
||||
pub struct CondPattern {
|
||||
pub nodes: (Expression, Keyword, Pattern),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,56 +7,56 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ContinuousAssign<'a> {
|
||||
Net(ContinuousAssignNet<'a>),
|
||||
Variable(ContinuousAssignVariable<'a>),
|
||||
pub enum ContinuousAssign {
|
||||
Net(ContinuousAssignNet),
|
||||
Variable(ContinuousAssignVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ContinuousAssignNet<'a> {
|
||||
pub struct ContinuousAssignNet {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<DriveStrength<'a>>,
|
||||
Option<Delay3<'a>>,
|
||||
ListOfNetAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<DriveStrength>,
|
||||
Option<Delay3>,
|
||||
ListOfNetAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ContinuousAssignVariable<'a> {
|
||||
pub struct ContinuousAssignVariable {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<DelayControl<'a>>,
|
||||
ListOfVariableAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<DelayControl>,
|
||||
ListOfVariableAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfNetAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, NetAssignment<'a>>,),
|
||||
pub struct ListOfNetAssignments {
|
||||
pub nodes: (List<Symbol, NetAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfVariableAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, VariableAssignment<'a>>,),
|
||||
pub struct ListOfVariableAssignments {
|
||||
pub nodes: (List<Symbol, VariableAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetAlias<'a> {
|
||||
pub struct NetAlias {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
NetLvalue<'a>,
|
||||
Symbol<'a>,
|
||||
List<Symbol<'a>, NetLvalue<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
NetLvalue,
|
||||
Symbol,
|
||||
List<Symbol, NetLvalue>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetAssignment<'a> {
|
||||
pub nodes: (NetLvalue<'a>, Symbol<'a>, Expression<'a>),
|
||||
pub struct NetAssignment {
|
||||
pub nodes: (NetLvalue, Symbol, Expression),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,114 +8,99 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LoopStatement<'a> {
|
||||
Forever(LoopStatementForever<'a>),
|
||||
Repeat(LoopStatementRepeat<'a>),
|
||||
While(LoopStatementWhile<'a>),
|
||||
For(LoopStatementFor<'a>),
|
||||
DoWhile(LoopStatementDoWhile<'a>),
|
||||
Foreach(LoopStatementForeach<'a>),
|
||||
pub enum LoopStatement {
|
||||
Forever(LoopStatementForever),
|
||||
Repeat(LoopStatementRepeat),
|
||||
While(LoopStatementWhile),
|
||||
For(LoopStatementFor),
|
||||
DoWhile(LoopStatementDoWhile),
|
||||
Foreach(LoopStatementForeach),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementForever<'a> {
|
||||
pub nodes: (Keyword<'a>, StatementOrNull<'a>),
|
||||
pub struct LoopStatementForever {
|
||||
pub nodes: (Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementRepeat<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
|
||||
pub struct LoopStatementRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementWhile<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
|
||||
pub struct LoopStatementWhile {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementFor<'a> {
|
||||
pub struct LoopStatementFor {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
Option<ForInitialization<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<Expression<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<ForStep<'a>>,
|
||||
),
|
||||
>,
|
||||
StatementOrNull<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
Option<ForInitialization>,
|
||||
Symbol,
|
||||
Option<Expression>,
|
||||
Symbol,
|
||||
Option<ForStep>,
|
||||
)>,
|
||||
StatementOrNull,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementDoWhile<'a> {
|
||||
pub struct LoopStatementDoWhile {
|
||||
pub nodes: (Keyword, StatementOrNull, Keyword, Paren<Expression>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementForeach {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
StatementOrNull<'a>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(PsOrHierarchicalArrayIdentifier, Bracket<LoopVariables>)>,
|
||||
Statement,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopStatementForeach<'a> {
|
||||
pub enum ForInitialization {
|
||||
ListOfVariableAssignments(ListOfVariableAssignments),
|
||||
Declaration(ForInitializationDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ForInitializationDeclaration {
|
||||
pub nodes: (List<Symbol, ForVariableDeclaration>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ForVariableDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
PsOrHierarchicalArrayIdentifier<'a>,
|
||||
Bracket<'a, LoopVariables<'a>>,
|
||||
),
|
||||
>,
|
||||
Statement<'a>,
|
||||
Option<Var>,
|
||||
DataType,
|
||||
List<Symbol, (VariableIdentifier, Symbol, Expression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ForInitialization<'a> {
|
||||
ListOfVariableAssignments(ListOfVariableAssignments<'a>),
|
||||
Declaration(ForInitializationDeclaration<'a>),
|
||||
pub struct Var {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ForInitializationDeclaration<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ForVariableDeclaration<'a>>,),
|
||||
pub struct ForStep {
|
||||
pub nodes: (List<Symbol, ForStepAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ForVariableDeclaration<'a> {
|
||||
pub nodes: (
|
||||
Option<Var<'a>>,
|
||||
DataType<'a>,
|
||||
List<Symbol<'a>, (VariableIdentifier<'a>, Symbol<'a>, Expression<'a>)>,
|
||||
),
|
||||
pub enum ForStepAssignment {
|
||||
OperatorAssignment(OperatorAssignment),
|
||||
IncOrDecExpression(IncOrDecExpression),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Var<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ForStep<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ForStepAssignment<'a>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ForStepAssignment<'a> {
|
||||
OperatorAssignment(OperatorAssignment<'a>),
|
||||
IncOrDecExpression(IncOrDecExpression<'a>),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopVariables<'a> {
|
||||
pub nodes: (List<Symbol<'a>, Option<IndexVariableIdentifier<'a>>>,),
|
||||
pub struct LoopVariables {
|
||||
pub nodes: (List<Symbol, Option<IndexVariableIdentifier>>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,45 +9,45 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ActionBlock<'a> {
|
||||
StatementOrNull(StatementOrNull<'a>),
|
||||
Else(ActionBlockElse<'a>),
|
||||
pub enum ActionBlock {
|
||||
StatementOrNull(StatementOrNull),
|
||||
Else(ActionBlockElse),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ActionBlockElse<'a> {
|
||||
pub nodes: (Option<Statement<'a>>, Keyword<'a>, StatementOrNull<'a>),
|
||||
pub struct ActionBlockElse {
|
||||
pub nodes: (Option<Statement>, Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SeqBlock<'a> {
|
||||
pub struct SeqBlock {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, BlockIdentifier<'a>)>,
|
||||
Vec<BlockItemDeclaration<'a>>,
|
||||
Vec<StatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, BlockIdentifier<'a>)>,
|
||||
Keyword,
|
||||
Option<(Symbol, BlockIdentifier)>,
|
||||
Vec<BlockItemDeclaration>,
|
||||
Vec<StatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, BlockIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParBlock<'a> {
|
||||
pub struct ParBlock {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, BlockIdentifier<'a>)>,
|
||||
Vec<BlockItemDeclaration<'a>>,
|
||||
Vec<StatementOrNull<'a>>,
|
||||
JoinKeyword<'a>,
|
||||
Option<(Symbol<'a>, BlockIdentifier<'a>)>,
|
||||
Keyword,
|
||||
Option<(Symbol, BlockIdentifier)>,
|
||||
Vec<BlockItemDeclaration>,
|
||||
Vec<StatementOrNull>,
|
||||
JoinKeyword,
|
||||
Option<(Symbol, BlockIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum JoinKeyword<'a> {
|
||||
Join(Keyword<'a>),
|
||||
JoinAny(Keyword<'a>),
|
||||
JoinNone(Keyword<'a>),
|
||||
pub enum JoinKeyword {
|
||||
Join(Keyword),
|
||||
JoinAny(Keyword),
|
||||
JoinNone(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,126 +8,107 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Pattern<'a> {
|
||||
Variable(Box<PatternVariable<'a>>),
|
||||
Asterisk(Symbol<'a>),
|
||||
ConstantExpression(Box<ConstantExpression<'a>>),
|
||||
Tagged(Box<PatternTagged<'a>>),
|
||||
List(Box<PatternList<'a>>),
|
||||
IdentifierList(Box<PatternIdentifierList<'a>>),
|
||||
pub enum Pattern {
|
||||
Variable(Box<PatternVariable>),
|
||||
Asterisk(Symbol),
|
||||
ConstantExpression(Box<ConstantExpression>),
|
||||
Tagged(Box<PatternTagged>),
|
||||
List(Box<PatternList>),
|
||||
IdentifierList(Box<PatternIdentifierList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PatternVariable<'a> {
|
||||
pub nodes: (Symbol<'a>, VariableIdentifier<'a>),
|
||||
pub struct PatternVariable {
|
||||
pub nodes: (Symbol, VariableIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PatternTagged<'a> {
|
||||
pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option<Pattern<'a>>),
|
||||
pub struct PatternTagged {
|
||||
pub nodes: (Keyword, MemberIdentifier, Option<Pattern>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PatternList<'a> {
|
||||
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, Pattern<'a>>>,),
|
||||
pub struct PatternList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, Pattern>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PatternIdentifierList<'a> {
|
||||
pub nodes:
|
||||
(ApostropheBrace<'a, List<Symbol<'a>, (MemberIdentifier<'a>, Symbol<'a>, Pattern<'a>)>>,),
|
||||
pub struct PatternIdentifierList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (MemberIdentifier, Symbol, Pattern)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssignmentPattern<'a> {
|
||||
List(AssignmentPatternList<'a>),
|
||||
Structure(AssignmentPatternStructure<'a>),
|
||||
Array(AssignmentPatternArray<'a>),
|
||||
Repeat(AssignmentPatternRepeat<'a>),
|
||||
pub enum AssignmentPattern {
|
||||
List(AssignmentPatternList),
|
||||
Structure(AssignmentPatternStructure),
|
||||
Array(AssignmentPatternArray),
|
||||
Repeat(AssignmentPatternRepeat),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternList<'a> {
|
||||
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, Expression<'a>>>,),
|
||||
pub struct AssignmentPatternList {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternStructure<'a> {
|
||||
pub nodes: (
|
||||
ApostropheBrace<
|
||||
'a,
|
||||
List<Symbol<'a>, (StructurePatternKey<'a>, Symbol<'a>, Expression<'a>)>,
|
||||
>,
|
||||
),
|
||||
pub struct AssignmentPatternStructure {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (StructurePatternKey, Symbol, Expression)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternArray<'a> {
|
||||
pub nodes: (
|
||||
ApostropheBrace<'a, List<Symbol<'a>, (ArrayPatternKey<'a>, Symbol<'a>, Expression<'a>)>>,
|
||||
),
|
||||
pub struct AssignmentPatternArray {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, (ArrayPatternKey, Symbol, Expression)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternRepeat<'a> {
|
||||
pub nodes: (
|
||||
ApostropheBrace<
|
||||
'a,
|
||||
(
|
||||
ConstantExpression<'a>,
|
||||
Brace<'a, List<Symbol<'a>, Expression<'a>>>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
pub struct AssignmentPatternRepeat {
|
||||
pub nodes: (ApostropheBrace<(ConstantExpression, Brace<List<Symbol, Expression>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StructurePatternKey<'a> {
|
||||
MemberIdentifier(MemberIdentifier<'a>),
|
||||
AssignmentPatternKey(AssignmentPatternKey<'a>),
|
||||
pub enum StructurePatternKey {
|
||||
MemberIdentifier(MemberIdentifier),
|
||||
AssignmentPatternKey(AssignmentPatternKey),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ArrayPatternKey<'a> {
|
||||
ConstantExpression(ConstantExpression<'a>),
|
||||
AssignmentPatternKey(AssignmentPatternKey<'a>),
|
||||
pub enum ArrayPatternKey {
|
||||
ConstantExpression(ConstantExpression),
|
||||
AssignmentPatternKey(AssignmentPatternKey),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssignmentPatternKey<'a> {
|
||||
SimpleType(SimpleType<'a>),
|
||||
Default(Keyword<'a>),
|
||||
pub enum AssignmentPatternKey {
|
||||
SimpleType(SimpleType),
|
||||
Default(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternExpression<'a> {
|
||||
pub nodes: (
|
||||
Option<AssignmentPatternExpressionType<'a>>,
|
||||
AssignmentPattern<'a>,
|
||||
),
|
||||
pub struct AssignmentPatternExpression {
|
||||
pub nodes: (Option<AssignmentPatternExpressionType>, AssignmentPattern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssignmentPatternExpressionType<'a> {
|
||||
PsTypeIdentifier(PsTypeIdentifier<'a>),
|
||||
PsParameterIdentifier(PsParameterIdentifier<'a>),
|
||||
IntegerAtomType(IntegerAtomType<'a>),
|
||||
TypeReference(TypeReference<'a>),
|
||||
pub enum AssignmentPatternExpressionType {
|
||||
PsTypeIdentifier(PsTypeIdentifier),
|
||||
PsParameterIdentifier(PsParameterIdentifier),
|
||||
IntegerAtomType(IntegerAtomType),
|
||||
TypeReference(TypeReference),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantAssignmentPatternExpression<'a> {
|
||||
pub nodes: (AssignmentPatternExpression<'a>,),
|
||||
pub struct ConstantAssignmentPatternExpression {
|
||||
pub nodes: (AssignmentPatternExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternNetLvalue<'a> {
|
||||
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, NetLvalue<'a>>>,),
|
||||
pub struct AssignmentPatternNetLvalue {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, NetLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentPatternVariableLvalue<'a> {
|
||||
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, VariableLvalue<'a>>>,),
|
||||
pub struct AssignmentPatternVariableLvalue {
|
||||
pub nodes: (ApostropheBrace<List<Symbol, VariableLvalue>>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,125 +7,125 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InitialConstruct<'a> {
|
||||
pub nodes: (Keyword<'a>, StatementOrNull<'a>),
|
||||
pub struct InitialConstruct {
|
||||
pub nodes: (Keyword, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AlwaysConstruct<'a> {
|
||||
pub nodes: (AlwaysKeyword<'a>, Statement<'a>),
|
||||
pub struct AlwaysConstruct {
|
||||
pub nodes: (AlwaysKeyword, Statement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AlwaysKeyword<'a> {
|
||||
Always(Keyword<'a>),
|
||||
AlwaysComb(Keyword<'a>),
|
||||
AlwaysLatch(Keyword<'a>),
|
||||
AlwaysFf(Keyword<'a>),
|
||||
pub enum AlwaysKeyword {
|
||||
Always(Keyword),
|
||||
AlwaysComb(Keyword),
|
||||
AlwaysLatch(Keyword),
|
||||
AlwaysFf(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FinalConstruct<'a> {
|
||||
pub nodes: (Keyword<'a>, FunctionStatement<'a>),
|
||||
pub struct FinalConstruct {
|
||||
pub nodes: (Keyword, FunctionStatement),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BlockingAssignment<'a> {
|
||||
Variable(BlockingAssignmentVariable<'a>),
|
||||
NonrangeVariable(BlockingAssignmentNonrangeVariable<'a>),
|
||||
HierarchicalVariable(BlockingAssignmentHierarchicalVariable<'a>),
|
||||
OperatorAssignment(OperatorAssignment<'a>),
|
||||
pub enum BlockingAssignment {
|
||||
Variable(BlockingAssignmentVariable),
|
||||
NonrangeVariable(BlockingAssignmentNonrangeVariable),
|
||||
HierarchicalVariable(BlockingAssignmentHierarchicalVariable),
|
||||
OperatorAssignment(OperatorAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockingAssignmentVariable<'a> {
|
||||
pub struct BlockingAssignmentVariable {
|
||||
pub nodes: (
|
||||
VariableLvalue<'a>,
|
||||
Symbol<'a>,
|
||||
DelayOrEventControl<'a>,
|
||||
Expression<'a>,
|
||||
VariableLvalue,
|
||||
Symbol,
|
||||
DelayOrEventControl,
|
||||
Expression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockingAssignmentNonrangeVariable<'a> {
|
||||
pub nodes: (NonrangeVariableLvalue<'a>, Symbol<'a>, DynamicArrayNew<'a>),
|
||||
pub struct BlockingAssignmentNonrangeVariable {
|
||||
pub nodes: (NonrangeVariableLvalue, Symbol, DynamicArrayNew),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockingAssignmentHierarchicalVariable<'a> {
|
||||
pub struct BlockingAssignmentHierarchicalVariable {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope<'a>>,
|
||||
HierarchicalVariableIdentifier<'a>,
|
||||
Select<'a>,
|
||||
Symbol<'a>,
|
||||
ClassNew<'a>,
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope>,
|
||||
HierarchicalVariableIdentifier,
|
||||
Select,
|
||||
Symbol,
|
||||
ClassNew,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OperatorAssignment<'a> {
|
||||
pub nodes: (VariableLvalue<'a>, AssignmentOperator<'a>, Expression<'a>),
|
||||
pub struct OperatorAssignment {
|
||||
pub nodes: (VariableLvalue, AssignmentOperator, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssignmentOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct AssignmentOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonblockingAssignment<'a> {
|
||||
pub struct NonblockingAssignment {
|
||||
pub nodes: (
|
||||
VariableLvalue<'a>,
|
||||
Symbol<'a>,
|
||||
Option<DelayOrEventControl<'a>>,
|
||||
Expression<'a>,
|
||||
VariableLvalue,
|
||||
Symbol,
|
||||
Option<DelayOrEventControl>,
|
||||
Expression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProceduralContinuousAssignment<'a> {
|
||||
Assign(ProceduralContinuousAssignmentAssign<'a>),
|
||||
Deassign(ProceduralContinuousAssignmentDeassign<'a>),
|
||||
ForceVariable(ProceduralContinuousAssignmentForceVariable<'a>),
|
||||
ForceNet(ProceduralContinuousAssignmentForceNet<'a>),
|
||||
ReleaseVariable(ProceduralContinuousAssignmentReleaseVariable<'a>),
|
||||
ReleaseNet(ProceduralContinuousAssignmentReleaseNet<'a>),
|
||||
pub enum ProceduralContinuousAssignment {
|
||||
Assign(ProceduralContinuousAssignmentAssign),
|
||||
Deassign(ProceduralContinuousAssignmentDeassign),
|
||||
ForceVariable(ProceduralContinuousAssignmentForceVariable),
|
||||
ForceNet(ProceduralContinuousAssignmentForceNet),
|
||||
ReleaseVariable(ProceduralContinuousAssignmentReleaseVariable),
|
||||
ReleaseNet(ProceduralContinuousAssignmentReleaseNet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentAssign<'a> {
|
||||
pub nodes: (Keyword<'a>, VariableAssignment<'a>),
|
||||
pub struct ProceduralContinuousAssignmentAssign {
|
||||
pub nodes: (Keyword, VariableAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentDeassign<'a> {
|
||||
pub nodes: (Keyword<'a>, VariableLvalue<'a>),
|
||||
pub struct ProceduralContinuousAssignmentDeassign {
|
||||
pub nodes: (Keyword, VariableLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentForceVariable<'a> {
|
||||
pub nodes: (Keyword<'a>, VariableAssignment<'a>),
|
||||
pub struct ProceduralContinuousAssignmentForceVariable {
|
||||
pub nodes: (Keyword, VariableAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentForceNet<'a> {
|
||||
pub nodes: (Keyword<'a>, NetAssignment<'a>),
|
||||
pub struct ProceduralContinuousAssignmentForceNet {
|
||||
pub nodes: (Keyword, NetAssignment),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentReleaseVariable<'a> {
|
||||
pub nodes: (Keyword<'a>, VariableLvalue<'a>),
|
||||
pub struct ProceduralContinuousAssignmentReleaseVariable {
|
||||
pub nodes: (Keyword, VariableLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralContinuousAssignmentReleaseNet<'a> {
|
||||
pub nodes: (Keyword<'a>, NetLvalue<'a>),
|
||||
pub struct ProceduralContinuousAssignmentReleaseNet {
|
||||
pub nodes: (Keyword, NetLvalue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableAssignment<'a> {
|
||||
pub nodes: (VariableLvalue<'a>, Symbol<'a>, Expression<'a>),
|
||||
pub struct VariableAssignment {
|
||||
pub nodes: (VariableLvalue, Symbol, Expression),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,143 +9,135 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RandsequenceStatement<'a> {
|
||||
pub struct RandsequenceStatement {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, Option<ProductionIdentifier<'a>>>,
|
||||
Production<'a>,
|
||||
Vec<Production<'a>>,
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Paren<Option<ProductionIdentifier>>,
|
||||
Production,
|
||||
Vec<Production>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Production<'a> {
|
||||
pub struct Production {
|
||||
pub nodes: (
|
||||
Option<DataTypeOrVoid<'a>>,
|
||||
ProductionIdentifier<'a>,
|
||||
Option<Paren<'a, TfPortList<'a>>>,
|
||||
Symbol<'a>,
|
||||
List<Symbol<'a>, RsRule<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<DataTypeOrVoid>,
|
||||
ProductionIdentifier,
|
||||
Option<Paren<TfPortList>>,
|
||||
Symbol,
|
||||
List<Symbol, RsRule>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsRule<'a> {
|
||||
pub struct RsRule {
|
||||
pub nodes: (
|
||||
RsProductionList<'a>,
|
||||
Option<(Symbol<'a>, WeightSpecification<'a>, Option<RsCodeBlock<'a>>)>,
|
||||
RsProductionList,
|
||||
Option<(Symbol, WeightSpecification, Option<RsCodeBlock>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RsProductionList<'a> {
|
||||
Prod(RsProductionListProd<'a>),
|
||||
Join(RsProductionListJoin<'a>),
|
||||
pub enum RsProductionList {
|
||||
Prod(RsProductionListProd),
|
||||
Join(RsProductionListJoin),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsProductionListProd<'a> {
|
||||
pub nodes: (RsProd<'a>, Vec<RsProd<'a>>),
|
||||
pub struct RsProductionListProd {
|
||||
pub nodes: (RsProd, Vec<RsProd>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsProductionListJoin<'a> {
|
||||
pub struct RsProductionListJoin {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Expression<'a>>>,
|
||||
ProductionItem<'a>,
|
||||
ProductionItem<'a>,
|
||||
Vec<ProductionItem<'a>>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Option<Paren<Expression>>,
|
||||
ProductionItem,
|
||||
ProductionItem,
|
||||
Vec<ProductionItem>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum WeightSpecification<'a> {
|
||||
IntegralNumber(IntegralNumber<'a>),
|
||||
PsIdentifier(PsIdentifier<'a>),
|
||||
Expression(WeightSpecificationExpression<'a>),
|
||||
pub enum WeightSpecification {
|
||||
IntegralNumber(IntegralNumber),
|
||||
PsIdentifier(PsIdentifier),
|
||||
Expression(WeightSpecificationExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WeightSpecificationExpression<'a> {
|
||||
pub nodes: (Paren<'a, Expression<'a>>,),
|
||||
pub struct WeightSpecificationExpression {
|
||||
pub nodes: (Paren<Expression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsCodeBlock<'a> {
|
||||
pub nodes: (Brace<'a, (Vec<DataDeclaration<'a>>, Vec<StatementOrNull<'a>>)>,),
|
||||
pub struct RsCodeBlock {
|
||||
pub nodes: (Brace<(Vec<DataDeclaration>, Vec<StatementOrNull>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RsProd<'a> {
|
||||
ProductionItem(ProductionItem<'a>),
|
||||
RsCodeBlock(RsCodeBlock<'a>),
|
||||
RsIfElse(RsIfElse<'a>),
|
||||
RsRepeat(RsRepeat<'a>),
|
||||
RsCase(RsCase<'a>),
|
||||
pub enum RsProd {
|
||||
ProductionItem(ProductionItem),
|
||||
RsCodeBlock(RsCodeBlock),
|
||||
RsIfElse(RsIfElse),
|
||||
RsRepeat(RsRepeat),
|
||||
RsCase(RsCase),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProductionItem<'a> {
|
||||
pub struct ProductionItem {
|
||||
pub nodes: (ProductionIdentifier, Option<Paren<ListOfArguments>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsIfElse {
|
||||
pub nodes: (
|
||||
ProductionIdentifier<'a>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
Keyword,
|
||||
Paren<Expression>,
|
||||
ProductionItem,
|
||||
Option<(Keyword, ProductionItem)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsIfElse<'a> {
|
||||
pub struct RsRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, ProductionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsCase {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
ProductionItem<'a>,
|
||||
Option<(Keyword<'a>, ProductionItem<'a>)>,
|
||||
Keyword,
|
||||
Paren<CaseExpression>,
|
||||
RsCaseItem,
|
||||
Vec<RsCaseItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsRepeat<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>),
|
||||
pub enum RsCaseItem {
|
||||
NonDefault(RsCaseItemNondefault),
|
||||
Default(RsCaseItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsCase<'a> {
|
||||
pub struct RsCaseItemNondefault {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, CaseExpression<'a>>,
|
||||
RsCaseItem<'a>,
|
||||
Vec<RsCaseItem<'a>>,
|
||||
Keyword<'a>,
|
||||
List<Symbol, CaseItemExpression>,
|
||||
Symbol,
|
||||
ProductionItem,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RsCaseItem<'a> {
|
||||
NonDefault(RsCaseItemNondefault<'a>),
|
||||
Default(RsCaseItemDefault<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsCaseItemNondefault<'a> {
|
||||
pub nodes: (
|
||||
List<Symbol<'a>, CaseItemExpression<'a>>,
|
||||
Symbol<'a>,
|
||||
ProductionItem<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RsCaseItemDefault<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Symbol<'a>>,
|
||||
ProductionItem<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
pub struct RsCaseItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, ProductionItem, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,68 +9,68 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StatementOrNull<'a> {
|
||||
Statement(Statement<'a>),
|
||||
Attribute(StatementOrNullAttribute<'a>),
|
||||
pub enum StatementOrNull {
|
||||
Statement(Statement),
|
||||
Attribute(StatementOrNullAttribute),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StatementOrNullAttribute<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
|
||||
pub struct StatementOrNullAttribute {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Statement<'a> {
|
||||
pub struct Statement {
|
||||
pub nodes: (
|
||||
Option<(BlockIdentifier<'a>, Symbol<'a>)>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
StatementItem<'a>,
|
||||
Option<(BlockIdentifier, Symbol)>,
|
||||
Vec<AttributeInstance>,
|
||||
StatementItem,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StatementItem<'a> {
|
||||
BlockingAssignment(Box<(BlockingAssignment<'a>, Symbol<'a>)>),
|
||||
NonblockingAssignment(Box<(NonblockingAssignment<'a>, Symbol<'a>)>),
|
||||
ProceduralContinuousAssignment(Box<(ProceduralContinuousAssignment<'a>, Symbol<'a>)>),
|
||||
CaseStatement(Box<CaseStatement<'a>>),
|
||||
ConditionalStatement(Box<ConditionalStatement<'a>>),
|
||||
IncOrDecExpression(Box<(IncOrDecExpression<'a>, Symbol<'a>)>),
|
||||
SubroutineCallStatement(Box<SubroutineCallStatement<'a>>),
|
||||
DisableStatement(Box<DisableStatement<'a>>),
|
||||
EventTrigger(Box<EventTrigger<'a>>),
|
||||
LoopStatement(Box<LoopStatement<'a>>),
|
||||
JumpStatement(Box<JumpStatement<'a>>),
|
||||
ParBlock(Box<ParBlock<'a>>),
|
||||
ProceduralTimingControlStatement(Box<ProceduralTimingControlStatement<'a>>),
|
||||
SeqBlock(Box<SeqBlock<'a>>),
|
||||
WaitStatement(Box<WaitStatement<'a>>),
|
||||
ProceduralAssertionStatement(Box<ProceduralAssertionStatement<'a>>),
|
||||
ClockingDrive(Box<(ClockingDrive<'a>, Symbol<'a>)>),
|
||||
RandsequenceStatement(Box<RandsequenceStatement<'a>>),
|
||||
RandcaseStatement(Box<RandcaseStatement<'a>>),
|
||||
ExpectPropertyStatement(Box<ExpectPropertyStatement<'a>>),
|
||||
pub enum StatementItem {
|
||||
BlockingAssignment(Box<(BlockingAssignment, Symbol)>),
|
||||
NonblockingAssignment(Box<(NonblockingAssignment, Symbol)>),
|
||||
ProceduralContinuousAssignment(Box<(ProceduralContinuousAssignment, Symbol)>),
|
||||
CaseStatement(Box<CaseStatement>),
|
||||
ConditionalStatement(Box<ConditionalStatement>),
|
||||
IncOrDecExpression(Box<(IncOrDecExpression, Symbol)>),
|
||||
SubroutineCallStatement(Box<SubroutineCallStatement>),
|
||||
DisableStatement(Box<DisableStatement>),
|
||||
EventTrigger(Box<EventTrigger>),
|
||||
LoopStatement(Box<LoopStatement>),
|
||||
JumpStatement(Box<JumpStatement>),
|
||||
ParBlock(Box<ParBlock>),
|
||||
ProceduralTimingControlStatement(Box<ProceduralTimingControlStatement>),
|
||||
SeqBlock(Box<SeqBlock>),
|
||||
WaitStatement(Box<WaitStatement>),
|
||||
ProceduralAssertionStatement(Box<ProceduralAssertionStatement>),
|
||||
ClockingDrive(Box<(ClockingDrive, Symbol)>),
|
||||
RandsequenceStatement(Box<RandsequenceStatement>),
|
||||
RandcaseStatement(Box<RandcaseStatement>),
|
||||
ExpectPropertyStatement(Box<ExpectPropertyStatement>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionStatement<'a> {
|
||||
pub nodes: (Statement<'a>,),
|
||||
pub struct FunctionStatement {
|
||||
pub nodes: (Statement,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum FunctionStatementOrNull<'a> {
|
||||
Statement(FunctionStatement<'a>),
|
||||
Attribute(FunctionStatementOrNullAttribute<'a>),
|
||||
pub enum FunctionStatementOrNull {
|
||||
Statement(FunctionStatement),
|
||||
Attribute(FunctionStatementOrNullAttribute),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionStatementOrNullAttribute<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
|
||||
pub struct FunctionStatementOrNullAttribute {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableIdentifierList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, VariableIdentifier<'a>>,),
|
||||
pub struct VariableIdentifierList {
|
||||
pub nodes: (List<Symbol, VariableIdentifier>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,19 +8,14 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SubroutineCallStatement<'a> {
|
||||
SubroutineCall((SubroutineCall<'a>, Symbol<'a>)),
|
||||
Function(SubroutineCallStatementFunction<'a>),
|
||||
pub enum SubroutineCallStatement {
|
||||
SubroutineCall((SubroutineCall, Symbol)),
|
||||
Function(SubroutineCallStatementFunction),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SubroutineCallStatementFunction<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Symbol<'a>,
|
||||
Paren<'a, FunctionSubroutineCall<'a>>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
pub struct SubroutineCallStatementFunction {
|
||||
pub nodes: (Keyword, Symbol, Paren<FunctionSubroutineCall>, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,206 +8,206 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProceduralTimingControlStatement<'a> {
|
||||
pub nodes: (ProceduralTimingControl<'a>, StatementOrNull<'a>),
|
||||
pub struct ProceduralTimingControlStatement {
|
||||
pub nodes: (ProceduralTimingControl, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DelayOrEventControl<'a> {
|
||||
Delay(DelayControl<'a>),
|
||||
Event(EventControl<'a>),
|
||||
Repeat(DelayOrEventControlRepeat<'a>),
|
||||
pub enum DelayOrEventControl {
|
||||
Delay(DelayControl),
|
||||
Event(EventControl),
|
||||
Repeat(DelayOrEventControlRepeat),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DelayOrEventControlRepeat<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, EventControl<'a>),
|
||||
pub struct DelayOrEventControlRepeat {
|
||||
pub nodes: (Keyword, Paren<Expression>, EventControl),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DelayControl<'a> {
|
||||
Delay(DelayControlDelay<'a>),
|
||||
Mintypmax(DelayControlMintypmax<'a>),
|
||||
pub enum DelayControl {
|
||||
Delay(DelayControlDelay),
|
||||
Mintypmax(DelayControlMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DelayControlDelay<'a> {
|
||||
pub nodes: (Symbol<'a>, DelayValue<'a>),
|
||||
pub struct DelayControlDelay {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DelayControlMintypmax<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, MintypmaxExpression<'a>>),
|
||||
pub struct DelayControlMintypmax {
|
||||
pub nodes: (Symbol, Paren<MintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EventControl<'a> {
|
||||
EventIdentifier(EventControlEventIdentifier<'a>),
|
||||
EventExpression(EventControlEventExpression<'a>),
|
||||
Asterisk(EventControlAsterisk<'a>),
|
||||
ParenAsterisk(EventControlParenAsterisk<'a>),
|
||||
SequenceIdentifier(EventControlSequenceIdentifier<'a>),
|
||||
pub enum EventControl {
|
||||
EventIdentifier(EventControlEventIdentifier),
|
||||
EventExpression(EventControlEventExpression),
|
||||
Asterisk(EventControlAsterisk),
|
||||
ParenAsterisk(EventControlParenAsterisk),
|
||||
SequenceIdentifier(EventControlSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventControlEventIdentifier<'a> {
|
||||
pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>),
|
||||
pub struct EventControlEventIdentifier {
|
||||
pub nodes: (Symbol, HierarchicalEventIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventControlEventExpression<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>),
|
||||
pub struct EventControlEventExpression {
|
||||
pub nodes: (Symbol, Paren<EventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventControlAsterisk<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct EventControlAsterisk {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventControlParenAsterisk<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, Symbol<'a>>),
|
||||
pub struct EventControlParenAsterisk {
|
||||
pub nodes: (Symbol, Paren<Symbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventControlSequenceIdentifier<'a> {
|
||||
pub nodes: (Symbol<'a>, PsOrHierarchicalSequenceIdentifier<'a>),
|
||||
pub struct EventControlSequenceIdentifier {
|
||||
pub nodes: (Symbol, PsOrHierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EventExpression<'a> {
|
||||
Expression(Box<EventExpressionExpression<'a>>),
|
||||
Sequence(Box<EventExpressionSequence<'a>>),
|
||||
Or(Box<EventExpressionOr<'a>>),
|
||||
Comma(Box<EventExpressionComma<'a>>),
|
||||
Paren(Box<EventExpressionParen<'a>>),
|
||||
pub enum EventExpression {
|
||||
Expression(Box<EventExpressionExpression>),
|
||||
Sequence(Box<EventExpressionSequence>),
|
||||
Or(Box<EventExpressionOr>),
|
||||
Comma(Box<EventExpressionComma>),
|
||||
Paren(Box<EventExpressionParen>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventExpressionExpression<'a> {
|
||||
pub struct EventExpressionExpression {
|
||||
pub nodes: (
|
||||
Option<EdgeIdentifier<'a>>,
|
||||
Expression<'a>,
|
||||
Option<(Keyword<'a>, Expression<'a>)>,
|
||||
Option<EdgeIdentifier>,
|
||||
Expression,
|
||||
Option<(Keyword, Expression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventExpressionSequence<'a> {
|
||||
pub nodes: (SequenceInstance<'a>, Option<(Keyword<'a>, Expression<'a>)>),
|
||||
pub struct EventExpressionSequence {
|
||||
pub nodes: (SequenceInstance, Option<(Keyword, Expression)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventExpressionOr<'a> {
|
||||
pub nodes: (EventExpression<'a>, Keyword<'a>, EventExpression<'a>),
|
||||
pub struct EventExpressionOr {
|
||||
pub nodes: (EventExpression, Keyword, EventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventExpressionComma<'a> {
|
||||
pub nodes: (EventExpression<'a>, Symbol<'a>, EventExpression<'a>),
|
||||
pub struct EventExpressionComma {
|
||||
pub nodes: (EventExpression, Symbol, EventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventExpressionParen<'a> {
|
||||
pub nodes: (Paren<'a, EventExpression<'a>>,),
|
||||
pub struct EventExpressionParen {
|
||||
pub nodes: (Paren<EventExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProceduralTimingControl<'a> {
|
||||
DelayControl(DelayControl<'a>),
|
||||
EventControl(EventControl<'a>),
|
||||
CycleDelay(CycleDelay<'a>),
|
||||
pub enum ProceduralTimingControl {
|
||||
DelayControl(DelayControl),
|
||||
EventControl(EventControl),
|
||||
CycleDelay(CycleDelay),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum JumpStatement<'a> {
|
||||
Return(JumpStatementReturn<'a>),
|
||||
Break(JumpStatementBreak<'a>),
|
||||
Continue(JumpStatementContinue<'a>),
|
||||
pub enum JumpStatement {
|
||||
Return(JumpStatementReturn),
|
||||
Break(JumpStatementBreak),
|
||||
Continue(JumpStatementContinue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct JumpStatementReturn<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<Expression<'a>>, Symbol<'a>),
|
||||
pub struct JumpStatementReturn {
|
||||
pub nodes: (Keyword, Option<Expression>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct JumpStatementBreak<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>),
|
||||
pub struct JumpStatementBreak {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct JumpStatementContinue<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>),
|
||||
pub struct JumpStatementContinue {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum WaitStatement<'a> {
|
||||
Wait(WaitStatementWait<'a>),
|
||||
Fork(WaitStatementFork<'a>),
|
||||
Order(WaitStatementOrder<'a>),
|
||||
pub enum WaitStatement {
|
||||
Wait(WaitStatementWait),
|
||||
Fork(WaitStatementFork),
|
||||
Order(WaitStatementOrder),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WaitStatementWait<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
|
||||
pub struct WaitStatementWait {
|
||||
pub nodes: (Keyword, Paren<Expression>, StatementOrNull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WaitStatementFork<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>),
|
||||
pub struct WaitStatementFork {
|
||||
pub nodes: (Keyword, Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WaitStatementOrder<'a> {
|
||||
pub struct WaitStatementOrder {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, List<Symbol<'a>, HierarchicalIdentifier<'a>>>,
|
||||
ActionBlock<'a>,
|
||||
Keyword,
|
||||
Paren<List<Symbol, HierarchicalIdentifier>>,
|
||||
ActionBlock,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EventTrigger<'a> {
|
||||
Named(EventTriggerNamed<'a>),
|
||||
Nonblocking(EventTriggerNonblocking<'a>),
|
||||
pub enum EventTrigger {
|
||||
Named(EventTriggerNamed),
|
||||
Nonblocking(EventTriggerNonblocking),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventTriggerNamed<'a> {
|
||||
pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>, Symbol<'a>),
|
||||
pub struct EventTriggerNamed {
|
||||
pub nodes: (Symbol, HierarchicalEventIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventTriggerNonblocking<'a> {
|
||||
pub struct EventTriggerNonblocking {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Option<DelayOrEventControl<'a>>,
|
||||
HierarchicalEventIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
Option<DelayOrEventControl>,
|
||||
HierarchicalEventIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DisableStatement<'a> {
|
||||
Task(DisableStatementTask<'a>),
|
||||
Block(DisableStatementBlock<'a>),
|
||||
Fork(DisableStatementFork<'a>),
|
||||
pub enum DisableStatement {
|
||||
Task(DisableStatementTask),
|
||||
Block(DisableStatementBlock),
|
||||
Fork(DisableStatementFork),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DisableStatementTask<'a> {
|
||||
pub nodes: (Keyword<'a>, HierarchicalTaskIdentifier<'a>, Symbol<'a>),
|
||||
pub struct DisableStatementTask {
|
||||
pub nodes: (Keyword, HierarchicalTaskIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DisableStatementBlock<'a> {
|
||||
pub nodes: (Keyword<'a>, HierarchicalBlockIdentifier<'a>, Symbol<'a>),
|
||||
pub struct DisableStatementBlock {
|
||||
pub nodes: (Keyword, HierarchicalBlockIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DisableStatementFork<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>),
|
||||
pub struct DisableStatementFork {
|
||||
pub nodes: (Keyword, Keyword, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,39 +7,39 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BlockItemDeclaration<'a> {
|
||||
Data(BlockItemDeclarationData<'a>),
|
||||
LocalParameter(BlockItemDeclarationLocalParameter<'a>),
|
||||
Parameter(BlockItemDeclarationParameter<'a>),
|
||||
Let(BlockItemDeclarationLet<'a>),
|
||||
pub enum BlockItemDeclaration {
|
||||
Data(BlockItemDeclarationData),
|
||||
LocalParameter(BlockItemDeclarationLocalParameter),
|
||||
Parameter(BlockItemDeclarationParameter),
|
||||
Let(BlockItemDeclarationLet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockItemDeclarationData<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, DataDeclaration<'a>),
|
||||
pub struct BlockItemDeclarationData {
|
||||
pub nodes: (Vec<AttributeInstance>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockItemDeclarationLocalParameter<'a> {
|
||||
pub struct BlockItemDeclarationLocalParameter {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
LocalParameterDeclaration<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
LocalParameterDeclaration,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockItemDeclarationParameter<'a> {
|
||||
pub struct BlockItemDeclarationParameter {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ParameterDeclaration<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
ParameterDeclaration,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockItemDeclarationLet<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, LetDeclaration<'a>),
|
||||
pub struct BlockItemDeclarationLet {
|
||||
pub nodes: (Vec<AttributeInstance>, LetDeclaration),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,514 +9,468 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupDeclaration<'a> {
|
||||
pub struct CovergroupDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
CovergroupIdentifier<'a>,
|
||||
Option<Paren<'a, Option<TfPortList<'a>>>>,
|
||||
Option<CoverageEvent<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<CoverageSpecOrOption<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, CovergroupIdentifier<'a>)>,
|
||||
Keyword,
|
||||
CovergroupIdentifier,
|
||||
Option<Paren<Option<TfPortList>>>,
|
||||
Option<CoverageEvent>,
|
||||
Symbol,
|
||||
Vec<CoverageSpecOrOption>,
|
||||
Keyword,
|
||||
Option<(Symbol, CovergroupIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CoverageSpecOrOption<'a> {
|
||||
Spec(CoverageSpecOrOptionSpec<'a>),
|
||||
Option(CoverageSpecOrOptionOption<'a>),
|
||||
pub enum CoverageSpecOrOption {
|
||||
Spec(CoverageSpecOrOptionSpec),
|
||||
Option(CoverageSpecOrOptionOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageSpecOrOptionSpec<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, CoverageSpec<'a>),
|
||||
pub struct CoverageSpecOrOptionSpec {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageSpec),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageSpecOrOptionOption<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, CoverageOption<'a>, Symbol<'a>),
|
||||
pub struct CoverageSpecOrOptionOption {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageOption, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CoverageOption<'a> {
|
||||
Option(CoverageOptionOption<'a>),
|
||||
TypeOption(CoverageOptionTypeOption<'a>),
|
||||
pub enum CoverageOption {
|
||||
Option(CoverageOptionOption),
|
||||
TypeOption(CoverageOptionTypeOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageOptionOption<'a> {
|
||||
pub struct CoverageOptionOption {
|
||||
pub nodes: (Keyword, Symbol, MemberIdentifier, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageOptionTypeOption {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Symbol<'a>,
|
||||
MemberIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Expression<'a>,
|
||||
Keyword,
|
||||
Symbol,
|
||||
MemberIdentifier,
|
||||
Symbol,
|
||||
ConstantExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageOptionTypeOption<'a> {
|
||||
pub enum CoverageSpec {
|
||||
CoverPoint(CoverPoint),
|
||||
CoverCross(CoverCross),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CoverageEvent {
|
||||
ClockingEvent(ClockingEvent),
|
||||
Sample(CoverageEventSample),
|
||||
At(CoverageEventAt),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageEventSample {
|
||||
pub nodes: (Keyword, Keyword, Keyword, Paren<Option<TfPortList>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageEventAt {
|
||||
pub nodes: (Symbol, Paren<BlockEventExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BlockEventExpression {
|
||||
Or(Box<BlockEventExpressionOr>),
|
||||
Begin(BlockEventExpressionBegin),
|
||||
End(BlockEventExpressionEnd),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionOr {
|
||||
pub nodes: (BlockEventExpression, Keyword, BlockEventExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionBegin {
|
||||
pub nodes: (Keyword, HierarchicalBtfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionEnd {
|
||||
pub nodes: (Keyword, HierarchicalBtfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum HierarchicalBtfIdentifier {
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier),
|
||||
HierarchicalBlockIdentifier(HierarchicalBlockIdentifier),
|
||||
Method(HierarchicalBtfIdentifierMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalBtfIdentifierMethod {
|
||||
pub nodes: (Option<HierarchicalIdentifierOrClassScope>, MethodIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum HierarchicalIdentifierOrClassScope {
|
||||
HierarchicalIdentifier((HierarchicalIdentifier, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverPoint {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Symbol<'a>,
|
||||
MemberIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantExpression<'a>,
|
||||
Option<(Option<DataTypeOrImplicit>, CoverPointIdentifier, Symbol)>,
|
||||
Keyword,
|
||||
Expression,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
BinsOrEmpty,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CoverageSpec<'a> {
|
||||
CoverPoint(CoverPoint<'a>),
|
||||
CoverCross(CoverCross<'a>),
|
||||
pub enum BinsOrEmpty {
|
||||
NonEmpty(BinsOrEmptyNonEmpty),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CoverageEvent<'a> {
|
||||
ClockingEvent(ClockingEvent<'a>),
|
||||
Sample(CoverageEventSample<'a>),
|
||||
At(CoverageEventAt<'a>),
|
||||
pub struct BinsOrEmptyNonEmpty {
|
||||
pub nodes: (Brace<(Vec<AttributeInstance>, Vec<(BinsOrOptions, Symbol)>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageEventSample<'a> {
|
||||
pub enum BinsOrOptions {
|
||||
CoverageOption(CoverageOption),
|
||||
Covergroup(BinsOrOptionsCovergroup),
|
||||
CoverPoint(BinsOrOptionsCoverPoint),
|
||||
SetCovergroup(BinsOrOptionsSetCovergroup),
|
||||
TransList(BinsOrOptionsTransList),
|
||||
Default(BinsOrOptionsDefault),
|
||||
DefaultSequence(BinsOrOptionsDefaultSequence),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsCovergroup {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, Option<TfPortList<'a>>>,
|
||||
Option<Wildcard>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Option<Bracket<Option<CovergroupExpression>>>,
|
||||
Symbol,
|
||||
Brace<CovergroupRangeList>,
|
||||
Option<(Keyword, Paren<WithCovergroupExpression>)>,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverageEventAt<'a> {
|
||||
pub nodes: (Symbol<'a>, Paren<'a, BlockEventExpression<'a>>),
|
||||
pub struct Wildcard {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BlockEventExpression<'a> {
|
||||
Or(Box<BlockEventExpressionOr<'a>>),
|
||||
Begin(BlockEventExpressionBegin<'a>),
|
||||
End(BlockEventExpressionEnd<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionOr<'a> {
|
||||
pub struct BinsOrOptionsCoverPoint {
|
||||
pub nodes: (
|
||||
BlockEventExpression<'a>,
|
||||
Keyword<'a>,
|
||||
BlockEventExpression<'a>,
|
||||
Option<Wildcard>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Option<Bracket<Option<CovergroupExpression>>>,
|
||||
Symbol,
|
||||
CoverPointIdentifier,
|
||||
Keyword,
|
||||
Paren<WithCovergroupExpression>,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionBegin<'a> {
|
||||
pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockEventExpressionEnd<'a> {
|
||||
pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum HierarchicalBtfIdentifier<'a> {
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier<'a>),
|
||||
HierarchicalBlockIdentifier(HierarchicalBlockIdentifier<'a>),
|
||||
Method(HierarchicalBtfIdentifierMethod<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalBtfIdentifierMethod<'a> {
|
||||
pub struct BinsOrOptionsSetCovergroup {
|
||||
pub nodes: (
|
||||
Option<HierarchicalIdentifierOrClassScope<'a>>,
|
||||
MethodIdentifier<'a>,
|
||||
Option<Wildcard>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Option<Bracket<Option<CovergroupExpression>>>,
|
||||
Symbol,
|
||||
SetCovergroupExpression,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum HierarchicalIdentifierOrClassScope<'a> {
|
||||
HierarchicalIdentifier((HierarchicalIdentifier<'a>, Symbol<'a>)),
|
||||
ClassScope(ClassScope<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverPoint<'a> {
|
||||
pub struct BinsOrOptionsTransList {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
CoverPointIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
)>,
|
||||
Keyword<'a>,
|
||||
Expression<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
BinsOrEmpty<'a>,
|
||||
Option<Wildcard>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Option<(Symbol, Symbol)>,
|
||||
Symbol,
|
||||
TransList,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsOrEmpty<'a> {
|
||||
NonEmpty(BinsOrEmptyNonEmpty<'a>),
|
||||
Empty(Symbol<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrEmptyNonEmpty<'a> {
|
||||
pub struct BinsOrOptionsDefault {
|
||||
pub nodes: (
|
||||
Brace<
|
||||
'a,
|
||||
(
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Vec<(BinsOrOptions<'a>, Symbol<'a>)>,
|
||||
),
|
||||
>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Option<Bracket<Option<CovergroupExpression>>>,
|
||||
Symbol,
|
||||
Keyword,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsOrOptions<'a> {
|
||||
CoverageOption(CoverageOption<'a>),
|
||||
Covergroup(BinsOrOptionsCovergroup<'a>),
|
||||
CoverPoint(BinsOrOptionsCoverPoint<'a>),
|
||||
SetCovergroup(BinsOrOptionsSetCovergroup<'a>),
|
||||
TransList(BinsOrOptionsTransList<'a>),
|
||||
Default(BinsOrOptionsDefault<'a>),
|
||||
DefaultSequence(BinsOrOptionsDefaultSequence<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsCovergroup<'a> {
|
||||
pub struct BinsOrOptionsDefaultSequence {
|
||||
pub nodes: (
|
||||
Option<Wildcard<'a>>,
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Option<Bracket<'a, Option<CovergroupExpression<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Brace<'a, CovergroupRangeList<'a>>,
|
||||
Option<(Keyword<'a>, Paren<'a, WithCovergroupExpression<'a>>)>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Symbol,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Wildcard<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub enum BinsKeyword {
|
||||
Bins(Keyword),
|
||||
IllegalBins(Keyword),
|
||||
IgnoreBins(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsCoverPoint<'a> {
|
||||
pub struct TransList {
|
||||
pub nodes: (List<Symbol, Paren<TransSet>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransSet {
|
||||
pub nodes: (List<Symbol, TransRangeList>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TransRangeList {
|
||||
TransItem(TransItem),
|
||||
Asterisk(TransRangeListAsterisk),
|
||||
Arrow(TransRangeListArrow),
|
||||
Equal(TransRangeListEqual),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListAsterisk {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListArrow {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListEqual {
|
||||
pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransItem {
|
||||
pub nodes: (CovergroupRangeList,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RepeatRange {
|
||||
CovergroupExpression(CovergroupExpression),
|
||||
Binary(RepeatRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RepeatRangeBinary {
|
||||
pub nodes: (CovergroupExpression, Symbol, CovergroupExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverCross {
|
||||
pub nodes: (
|
||||
Option<Wildcard<'a>>,
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Option<Bracket<'a, Option<CovergroupExpression<'a>>>>,
|
||||
Symbol<'a>,
|
||||
CoverPointIdentifier<'a>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, WithCovergroupExpression<'a>>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
Option<(CrossIdentifier, Symbol)>,
|
||||
Keyword,
|
||||
ListOfCrossItems,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
CrossBody,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsSetCovergroup<'a> {
|
||||
pub struct ListOfCrossItems {
|
||||
pub nodes: (CrossItem, List<Symbol, CrossItem>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossItem {
|
||||
CoverPointIdentifier(CoverPointIdentifier),
|
||||
VariableIdentifier(VariableIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossBody {
|
||||
NonEmpty(CrossBodyNonEmpty),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CrossBodyNonEmpty {
|
||||
pub nodes: (Brace<Vec<(CrossBodyItem, Symbol)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossBodyItem {
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
BinsSelectionOrOption((BinsSelectionOrOption, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsSelectionOrOption {
|
||||
Coverage(BinsSelectionOrOptionCoverage),
|
||||
Bins(BinsSelectionOrOptionBins),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionCoverage {
|
||||
pub nodes: (Vec<AttributeInstance>, CoverageOption),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionBins {
|
||||
pub nodes: (Vec<AttributeInstance>, BinsSelection),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelection {
|
||||
pub nodes: (
|
||||
Option<Wildcard<'a>>,
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Option<Bracket<'a, Option<CovergroupExpression<'a>>>>,
|
||||
Symbol<'a>,
|
||||
SetCovergroupExpression<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
BinsKeyword,
|
||||
BinIdentifier,
|
||||
Symbol,
|
||||
SelectExpression,
|
||||
Option<(Keyword, Paren<Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsTransList<'a> {
|
||||
pub enum SelectExpression {
|
||||
SelectCondition(SelectCondition),
|
||||
Not(SelectExpressionNot),
|
||||
And(Box<SelectExpressionAnd>),
|
||||
Or(Box<SelectExpressionOr>),
|
||||
Paren(Box<SelectExpressionParen>),
|
||||
With(Box<SelectExpressionWith>),
|
||||
CrossIdentifier(CrossIdentifier),
|
||||
CrossSet(SelectExpressionCrossSet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionNot {
|
||||
pub nodes: (Symbol, SelectCondition),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionAnd {
|
||||
pub nodes: (SelectExpression, Symbol, SelectExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionOr {
|
||||
pub nodes: (SelectExpression, Symbol, SelectExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionParen {
|
||||
pub nodes: (Paren<SelectExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionWith {
|
||||
pub nodes: (
|
||||
Option<Wildcard<'a>>,
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Option<(Symbol<'a>, Symbol<'a>)>,
|
||||
Symbol<'a>,
|
||||
TransList<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
SelectExpression,
|
||||
Keyword,
|
||||
Paren<WithCovergroupExpression>,
|
||||
Option<(Keyword, IntegerCovergroupExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsDefault<'a> {
|
||||
pub struct SelectExpressionCrossSet {
|
||||
pub nodes: (
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Option<Bracket<'a, Option<CovergroupExpression<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
CrossSetExpression,
|
||||
Option<(Keyword, IntegerCovergroupExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsOrOptionsDefaultSequence<'a> {
|
||||
pub struct SelectCondition {
|
||||
pub nodes: (
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
Keyword,
|
||||
Paren<BinsExpression>,
|
||||
Option<(Keyword, Brace<CovergroupRangeList>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsKeyword<'a> {
|
||||
Bins(Keyword<'a>),
|
||||
IllegalBins(Keyword<'a>),
|
||||
IgnoreBins(Keyword<'a>),
|
||||
pub enum BinsExpression {
|
||||
VariableIdentifier(VariableIdentifier),
|
||||
CoverPoint(BinsExpressionCoverPoint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, Paren<'a, TransSet<'a>>>,),
|
||||
pub struct BinsExpressionCoverPoint {
|
||||
pub nodes: (CoverPointIdentifier, Option<(Symbol, BinIdentifier)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransSet<'a> {
|
||||
pub nodes: (List<Symbol<'a>, TransRangeList<'a>>,),
|
||||
pub struct CovergroupRangeList {
|
||||
pub nodes: (List<Symbol, CovergroupValueRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TransRangeList<'a> {
|
||||
TransItem(TransItem<'a>),
|
||||
Asterisk(TransRangeListAsterisk<'a>),
|
||||
Arrow(TransRangeListArrow<'a>),
|
||||
Equal(TransRangeListEqual<'a>),
|
||||
pub enum CovergroupValueRange {
|
||||
CovergroupExpression(CovergroupExpression),
|
||||
Binary(CovergroupValueRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListAsterisk<'a> {
|
||||
pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>),
|
||||
pub struct CovergroupValueRangeBinary {
|
||||
pub nodes: (Bracket<(CovergroupExpression, Symbol, CovergroupExpression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListArrow<'a> {
|
||||
pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>),
|
||||
pub struct WithCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransRangeListEqual<'a> {
|
||||
pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>),
|
||||
pub struct SetCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TransItem<'a> {
|
||||
pub nodes: (CovergroupRangeList<'a>,),
|
||||
pub struct IntegerCovergroupExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RepeatRange<'a> {
|
||||
CovergroupExpression(CovergroupExpression<'a>),
|
||||
Binary(RepeatRangeBinary<'a>),
|
||||
pub struct CrossSetExpression {
|
||||
pub nodes: (CovergroupExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RepeatRangeBinary<'a> {
|
||||
pub nodes: (
|
||||
CovergroupExpression<'a>,
|
||||
Symbol<'a>,
|
||||
CovergroupExpression<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverCross<'a> {
|
||||
pub nodes: (
|
||||
Option<(CrossIdentifier<'a>, Symbol<'a>)>,
|
||||
Keyword<'a>,
|
||||
ListOfCrossItems<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
CrossBody<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfCrossItems<'a> {
|
||||
pub nodes: (CrossItem<'a>, List<Symbol<'a>, CrossItem<'a>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossItem<'a> {
|
||||
CoverPointIdentifier(CoverPointIdentifier<'a>),
|
||||
VariableIdentifier(VariableIdentifier<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossBody<'a> {
|
||||
NonEmpty(CrossBodyNonEmpty<'a>),
|
||||
Empty(Symbol<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CrossBodyNonEmpty<'a> {
|
||||
pub nodes: (Brace<'a, Vec<(CrossBodyItem<'a>, Symbol<'a>)>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CrossBodyItem<'a> {
|
||||
FunctionDeclaration(FunctionDeclaration<'a>),
|
||||
BinsSelectionOrOption((BinsSelectionOrOption<'a>, Symbol<'a>)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsSelectionOrOption<'a> {
|
||||
Coverage(BinsSelectionOrOptionCoverage<'a>),
|
||||
Bins(BinsSelectionOrOptionBins<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionCoverage<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, CoverageOption<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelectionOrOptionBins<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, BinsSelection<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsSelection<'a> {
|
||||
pub nodes: (
|
||||
BinsKeyword<'a>,
|
||||
BinIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
SelectExpression<'a>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SelectExpression<'a> {
|
||||
SelectCondition(SelectCondition<'a>),
|
||||
Not(SelectExpressionNot<'a>),
|
||||
And(Box<SelectExpressionAnd<'a>>),
|
||||
Or(Box<SelectExpressionOr<'a>>),
|
||||
Paren(Box<SelectExpressionParen<'a>>),
|
||||
With(Box<SelectExpressionWith<'a>>),
|
||||
CrossIdentifier(CrossIdentifier<'a>),
|
||||
CrossSet(SelectExpressionCrossSet<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionNot<'a> {
|
||||
pub nodes: (Symbol<'a>, SelectCondition<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionAnd<'a> {
|
||||
pub nodes: (SelectExpression<'a>, Symbol<'a>, SelectExpression<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionOr<'a> {
|
||||
pub nodes: (SelectExpression<'a>, Symbol<'a>, SelectExpression<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionParen<'a> {
|
||||
pub nodes: (Paren<'a, SelectExpression<'a>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionWith<'a> {
|
||||
pub nodes: (
|
||||
SelectExpression<'a>,
|
||||
Keyword<'a>,
|
||||
Paren<'a, WithCovergroupExpression<'a>>,
|
||||
Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectExpressionCrossSet<'a> {
|
||||
pub nodes: (
|
||||
CrossSetExpression<'a>,
|
||||
Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SelectCondition<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, BinsExpression<'a>>,
|
||||
Option<(Keyword<'a>, Brace<'a, CovergroupRangeList<'a>>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BinsExpression<'a> {
|
||||
VariableIdentifier(VariableIdentifier<'a>),
|
||||
CoverPoint(BinsExpressionCoverPoint<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinsExpressionCoverPoint<'a> {
|
||||
pub nodes: (
|
||||
CoverPointIdentifier<'a>,
|
||||
Option<(Symbol<'a>, BinIdentifier<'a>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupRangeList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, CovergroupValueRange<'a>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CovergroupValueRange<'a> {
|
||||
CovergroupExpression(CovergroupExpression<'a>),
|
||||
Binary(CovergroupValueRangeBinary<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupValueRangeBinary<'a> {
|
||||
pub nodes: (
|
||||
Bracket<
|
||||
'a,
|
||||
(
|
||||
CovergroupExpression<'a>,
|
||||
Symbol<'a>,
|
||||
CovergroupExpression<'a>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WithCovergroupExpression<'a> {
|
||||
pub nodes: (CovergroupExpression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SetCovergroupExpression<'a> {
|
||||
pub nodes: (CovergroupExpression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IntegerCovergroupExpression<'a> {
|
||||
pub nodes: (CovergroupExpression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CrossSetExpression<'a> {
|
||||
pub nodes: (CovergroupExpression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupExpression<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct CovergroupExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,167 +9,140 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DefparamAssignment<'a> {
|
||||
pub struct DefparamAssignment {
|
||||
pub nodes: (
|
||||
HierarchicalParameterIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantMintypmaxExpression<'a>,
|
||||
HierarchicalParameterIdentifier,
|
||||
Symbol,
|
||||
ConstantMintypmaxExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetDeclAssignment<'a> {
|
||||
pub struct NetDeclAssignment {
|
||||
pub nodes: (
|
||||
NetIdentifier<'a>,
|
||||
Vec<UnpackedDimension<'a>>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
NetIdentifier,
|
||||
Vec<UnpackedDimension>,
|
||||
Option<(Symbol, Expression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParamAssignment<'a> {
|
||||
pub struct ParamAssignment {
|
||||
pub nodes: (
|
||||
ParameterIdentifier<'a>,
|
||||
Vec<UnpackedDimension<'a>>,
|
||||
Option<(Symbol<'a>, ConstantParamExpression<'a>)>,
|
||||
ParameterIdentifier,
|
||||
Vec<UnpackedDimension>,
|
||||
Option<(Symbol, ConstantParamExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SpecparamAssignment<'a> {
|
||||
Mintypmax(SpecparamAssignmentMintypmax<'a>),
|
||||
PulseControlSpecparam(PulseControlSpecparam<'a>),
|
||||
pub enum SpecparamAssignment {
|
||||
Mintypmax(SpecparamAssignmentMintypmax),
|
||||
PulseControlSpecparam(PulseControlSpecparam),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecparamAssignmentMintypmax<'a> {
|
||||
pub struct SpecparamAssignmentMintypmax {
|
||||
pub nodes: (SpecparamIdentifier, Symbol, ConstantMintypmaxExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeAssignment {
|
||||
pub nodes: (TypeIdentifier, Option<(Symbol, DataType)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PulseControlSpecparam {
|
||||
WithoutDescriptor(PulseControlSpecparamWithoutDescriptor),
|
||||
WithDescriptor(PulseControlSpecparamWithDescriptor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulseControlSpecparamWithoutDescriptor {
|
||||
pub nodes: (
|
||||
SpecparamIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantMintypmaxExpression<'a>,
|
||||
Symbol,
|
||||
Symbol,
|
||||
Paren<(RejectLimitValue, Option<(Symbol, ErrorLimitValue)>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeAssignment<'a> {
|
||||
pub nodes: (TypeIdentifier<'a>, Option<(Symbol<'a>, DataType<'a>)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PulseControlSpecparam<'a> {
|
||||
WithoutDescriptor(PulseControlSpecparamWithoutDescriptor<'a>),
|
||||
WithDescriptor(PulseControlSpecparamWithDescriptor<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulseControlSpecparamWithoutDescriptor<'a> {
|
||||
pub struct PulseControlSpecparamWithDescriptor {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
RejectLimitValue<'a>,
|
||||
Option<(Symbol<'a>, ErrorLimitValue<'a>)>,
|
||||
),
|
||||
>,
|
||||
Symbol,
|
||||
SpecifyInputTerminalDescriptor,
|
||||
Symbol,
|
||||
SpecifyOutputTerminalDescriptor,
|
||||
Symbol,
|
||||
Paren<(RejectLimitValue, Option<(Symbol, ErrorLimitValue)>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulseControlSpecparamWithDescriptor<'a> {
|
||||
pub struct ErrorLimitValue {
|
||||
pub nodes: (LimitValue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RejectLimitValue {
|
||||
pub nodes: (LimitValue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LimitValue {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VariableDeclAssignment {
|
||||
Variable(VariableDeclAssignmentVariable),
|
||||
DynamicArray(VariableDeclAssignmentDynamicArray),
|
||||
Class(VariableDeclAssignmentClass),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableDeclAssignmentVariable {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
SpecifyInputTerminalDescriptor<'a>,
|
||||
Symbol<'a>,
|
||||
SpecifyOutputTerminalDescriptor<'a>,
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
RejectLimitValue<'a>,
|
||||
Option<(Symbol<'a>, ErrorLimitValue<'a>)>,
|
||||
),
|
||||
>,
|
||||
VariableIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, Expression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ErrorLimitValue<'a> {
|
||||
pub nodes: (LimitValue<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RejectLimitValue<'a> {
|
||||
pub nodes: (LimitValue<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LimitValue<'a> {
|
||||
pub nodes: (ConstantMintypmaxExpression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VariableDeclAssignment<'a> {
|
||||
Variable(VariableDeclAssignmentVariable<'a>),
|
||||
DynamicArray(VariableDeclAssignmentDynamicArray<'a>),
|
||||
Class(VariableDeclAssignmentClass<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableDeclAssignmentVariable<'a> {
|
||||
pub struct VariableDeclAssignmentDynamicArray {
|
||||
pub nodes: (
|
||||
VariableIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
DynamicArrayVariableIdentifier,
|
||||
UnsizedDimension,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, DynamicArrayNew)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableDeclAssignmentDynamicArray<'a> {
|
||||
pub nodes: (
|
||||
DynamicArrayVariableIdentifier<'a>,
|
||||
UnsizedDimension<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, DynamicArrayNew<'a>)>,
|
||||
),
|
||||
pub struct VariableDeclAssignmentClass {
|
||||
pub nodes: (ClassVariableIdentifier, Option<(Symbol, ClassNew)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableDeclAssignmentClass<'a> {
|
||||
pub nodes: (
|
||||
ClassVariableIdentifier<'a>,
|
||||
Option<(Symbol<'a>, ClassNew<'a>)>,
|
||||
),
|
||||
pub enum ClassNew {
|
||||
Argument(ClassNewArgument),
|
||||
Expression(ClassNewExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassNew<'a> {
|
||||
Argument(ClassNewArgument<'a>),
|
||||
Expression(ClassNewExpression<'a>),
|
||||
pub struct ClassNewArgument {
|
||||
pub nodes: (Option<ClassScope>, Keyword, Option<Paren<ListOfArguments>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassNewArgument<'a> {
|
||||
pub nodes: (
|
||||
Option<ClassScope<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
),
|
||||
pub struct ClassNewExpression {
|
||||
pub nodes: (Keyword, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassNewExpression<'a> {
|
||||
pub nodes: (Keyword<'a>, Expression<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DynamicArrayNew<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Bracket<'a, Expression<'a>>,
|
||||
Option<Paren<'a, Expression<'a>>>,
|
||||
),
|
||||
pub struct DynamicArrayNew {
|
||||
pub nodes: (Keyword, Bracket<Expression>, Option<Paren<Expression>>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,83 +8,83 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfDefparamAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, DefparamAssignment<'a>>,),
|
||||
pub struct ListOfDefparamAssignments {
|
||||
pub nodes: (List<Symbol, DefparamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfGenvarIdentifiers<'a> {
|
||||
pub nodes: (List<Symbol<'a>, GenvarIdentifier<'a>>,),
|
||||
pub struct ListOfGenvarIdentifiers {
|
||||
pub nodes: (List<Symbol, GenvarIdentifier>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfInterfaceIdentifiers<'a> {
|
||||
pub nodes: (List<Symbol<'a>, (InterfaceIdentifier<'a>, Vec<UnpackedDimension<'a>>)>,),
|
||||
pub struct ListOfInterfaceIdentifiers {
|
||||
pub nodes: (List<Symbol, (InterfaceIdentifier, Vec<UnpackedDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfNetDeclAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, NetDeclAssignment<'a>>,),
|
||||
pub struct ListOfNetDeclAssignments {
|
||||
pub nodes: (List<Symbol, NetDeclAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfParamAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ParamAssignment<'a>>,),
|
||||
pub struct ListOfParamAssignments {
|
||||
pub nodes: (List<Symbol, ParamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPortIdentifiers<'a> {
|
||||
pub nodes: (List<Symbol<'a>, (PortIdentifier<'a>, Vec<UnpackedDimension<'a>>)>,),
|
||||
pub struct ListOfPortIdentifiers {
|
||||
pub nodes: (List<Symbol, (PortIdentifier, Vec<UnpackedDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfUdpPortIdentifiers<'a> {
|
||||
pub nodes: (List<Symbol<'a>, PortIdentifier<'a>>,),
|
||||
pub struct ListOfUdpPortIdentifiers {
|
||||
pub nodes: (List<Symbol, PortIdentifier>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfSpecparamAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, SpecparamAssignment<'a>>,),
|
||||
pub struct ListOfSpecparamAssignments {
|
||||
pub nodes: (List<Symbol, SpecparamAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfTfVariableIdentifiers<'a> {
|
||||
pub struct ListOfTfVariableIdentifiers {
|
||||
pub nodes: (
|
||||
List<
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
(
|
||||
PortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
PortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, Expression)>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfTypeAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, TypeAssignment<'a>>,),
|
||||
pub struct ListOfTypeAssignments {
|
||||
pub nodes: (List<Symbol, TypeAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfVariableDeclAssignments<'a> {
|
||||
pub nodes: (List<Symbol<'a>, VariableDeclAssignment<'a>>,),
|
||||
pub struct ListOfVariableDeclAssignments {
|
||||
pub nodes: (List<Symbol, VariableDeclAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfVariableIdentifiers<'a> {
|
||||
pub nodes: (List<Symbol<'a>, (VariableIdentifier<'a>, Vec<VariableDimension<'a>>)>,),
|
||||
pub struct ListOfVariableIdentifiers {
|
||||
pub nodes: (List<Symbol, (VariableIdentifier, Vec<VariableDimension>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfVariablePortIdentifiers<'a> {
|
||||
pub struct ListOfVariablePortIdentifiers {
|
||||
pub nodes: (
|
||||
List<
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
(
|
||||
PortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
PortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
|
@ -8,64 +8,64 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UnpackedDimension<'a> {
|
||||
Range(UnpackedDimensionRange<'a>),
|
||||
Expression(UnpackedDimensionExpression<'a>),
|
||||
pub enum UnpackedDimension {
|
||||
Range(UnpackedDimensionRange),
|
||||
Expression(UnpackedDimensionExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnpackedDimensionRange<'a> {
|
||||
pub nodes: (Bracket<'a, ConstantRange<'a>>,),
|
||||
pub struct UnpackedDimensionRange {
|
||||
pub nodes: (Bracket<ConstantRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnpackedDimensionExpression<'a> {
|
||||
pub nodes: (Bracket<'a, ConstantExpression<'a>>,),
|
||||
pub struct UnpackedDimensionExpression {
|
||||
pub nodes: (Bracket<ConstantExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackedDimension<'a> {
|
||||
Range(PackedDimensionRange<'a>),
|
||||
UnsizedDimension(UnsizedDimension<'a>),
|
||||
pub enum PackedDimension {
|
||||
Range(PackedDimensionRange),
|
||||
UnsizedDimension(UnsizedDimension),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackedDimensionRange<'a> {
|
||||
pub nodes: (Bracket<'a, ConstantRange<'a>>,),
|
||||
pub struct PackedDimensionRange {
|
||||
pub nodes: (Bracket<ConstantRange>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AssociativeDimension<'a> {
|
||||
DataType(AssociativeDimensionDataType<'a>),
|
||||
Asterisk(AssociativeDimensionAsterisk<'a>),
|
||||
pub enum AssociativeDimension {
|
||||
DataType(AssociativeDimensionDataType),
|
||||
Asterisk(AssociativeDimensionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssociativeDimensionDataType<'a> {
|
||||
pub nodes: (Bracket<'a, DataType<'a>>,),
|
||||
pub struct AssociativeDimensionDataType {
|
||||
pub nodes: (Bracket<DataType>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AssociativeDimensionAsterisk<'a> {
|
||||
pub nodes: (Bracket<'a, Symbol<'a>>,),
|
||||
pub struct AssociativeDimensionAsterisk {
|
||||
pub nodes: (Bracket<Symbol>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VariableDimension<'a> {
|
||||
UnsizedDimension(UnsizedDimension<'a>),
|
||||
UnpackedDimension(UnpackedDimension<'a>),
|
||||
AssociativeDimension(AssociativeDimension<'a>),
|
||||
QueueDimension(QueueDimension<'a>),
|
||||
pub enum VariableDimension {
|
||||
UnsizedDimension(UnsizedDimension),
|
||||
UnpackedDimension(UnpackedDimension),
|
||||
AssociativeDimension(AssociativeDimension),
|
||||
QueueDimension(QueueDimension),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct QueueDimension<'a> {
|
||||
pub nodes: (Bracket<'a, (Symbol<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>)>,),
|
||||
pub struct QueueDimension {
|
||||
pub nodes: (Bracket<(Symbol, Option<(Symbol, ConstantExpression)>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnsizedDimension<'a> {
|
||||
pub nodes: (Symbol<'a>, Symbol<'a>),
|
||||
pub struct UnsizedDimension {
|
||||
pub nodes: (Symbol, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,66 +8,57 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Delay3<'a> {
|
||||
Single(Delay3Single<'a>),
|
||||
Mintypmax(Delay3Mintypmax<'a>),
|
||||
pub enum Delay3 {
|
||||
Single(Delay3Single),
|
||||
Mintypmax(Delay3Mintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Delay3Single<'a> {
|
||||
pub nodes: (Symbol<'a>, DelayValue<'a>),
|
||||
pub struct Delay3Single {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Delay3Mintypmax<'a> {
|
||||
pub struct Delay3Mintypmax {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
MintypmaxExpression<'a>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
MintypmaxExpression<'a>,
|
||||
Option<(Symbol<'a>, MintypmaxExpression<'a>)>,
|
||||
)>,
|
||||
),
|
||||
>,
|
||||
Symbol,
|
||||
Paren<(
|
||||
MintypmaxExpression,
|
||||
Option<(
|
||||
Symbol,
|
||||
MintypmaxExpression,
|
||||
Option<(Symbol, MintypmaxExpression)>,
|
||||
)>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Delay2<'a> {
|
||||
Single(Delay2Single<'a>),
|
||||
Mintypmax(Delay2Mintypmax<'a>),
|
||||
pub enum Delay2 {
|
||||
Single(Delay2Single),
|
||||
Mintypmax(Delay2Mintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Delay2Single<'a> {
|
||||
pub nodes: (Symbol<'a>, DelayValue<'a>),
|
||||
pub struct Delay2Single {
|
||||
pub nodes: (Symbol, DelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Delay2Mintypmax<'a> {
|
||||
pub struct Delay2Mintypmax {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
MintypmaxExpression<'a>,
|
||||
Option<(Symbol<'a>, MintypmaxExpression<'a>)>,
|
||||
),
|
||||
>,
|
||||
Symbol,
|
||||
Paren<(MintypmaxExpression, Option<(Symbol, MintypmaxExpression)>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DelayValue<'a> {
|
||||
UnsignedNumber(UnsignedNumber<'a>),
|
||||
RealNumber(RealNumber<'a>),
|
||||
PsIdentifier(PsIdentifier<'a>),
|
||||
TimeLiteral(TimeLiteral<'a>),
|
||||
Step1(Keyword<'a>),
|
||||
pub enum DelayValue {
|
||||
UnsignedNumber(UnsignedNumber),
|
||||
RealNumber(RealNumber),
|
||||
PsIdentifier(PsIdentifier),
|
||||
TimeLiteral(TimeLiteral),
|
||||
Step1(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,152 +9,148 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum FunctionDataTypeOrImplicit<'a> {
|
||||
DataTypeOrVoid(DataTypeOrVoid<'a>),
|
||||
ImplicitDataType(ImplicitDataType<'a>),
|
||||
pub enum FunctionDataTypeOrImplicit {
|
||||
DataTypeOrVoid(DataTypeOrVoid),
|
||||
ImplicitDataType(ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionDeclaration<'a> {
|
||||
pub struct FunctionDeclaration {
|
||||
pub nodes: (Keyword, Option<Lifetime>, FunctionBodyDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum FunctionBodyDeclaration {
|
||||
WithoutPort(FunctionBodyDeclarationWithoutPort),
|
||||
WithPort(FunctionBodyDeclarationWithPort),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionBodyDeclarationWithoutPort {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
FunctionBodyDeclaration<'a>,
|
||||
Option<FunctionDataTypeOrImplicit>,
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
FunctionIdentifier,
|
||||
Symbol,
|
||||
Vec<TfItemDeclaration>,
|
||||
Vec<FunctionStatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, FunctionIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum FunctionBodyDeclaration<'a> {
|
||||
WithoutPort(FunctionBodyDeclarationWithoutPort<'a>),
|
||||
WithPort(FunctionBodyDeclarationWithPort<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionBodyDeclarationWithoutPort<'a> {
|
||||
pub struct FunctionBodyDeclarationWithPort {
|
||||
pub nodes: (
|
||||
Option<FunctionDataTypeOrImplicit<'a>>,
|
||||
Option<InterfaceIdentifierOrClassScope<'a>>,
|
||||
FunctionIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<TfItemDeclaration<'a>>,
|
||||
Vec<FunctionStatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, FunctionIdentifier<'a>)>,
|
||||
Option<FunctionDataTypeOrImplicit>,
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
FunctionIdentifier,
|
||||
Paren<Option<TfPortList>>,
|
||||
Symbol,
|
||||
Vec<BlockItemDeclaration>,
|
||||
Vec<FunctionStatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, FunctionIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionBodyDeclarationWithPort<'a> {
|
||||
pub enum InterfaceIdentifierOrClassScope {
|
||||
InterfaceIdentifier((InterfaceIdentifier, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionPrototype {
|
||||
pub nodes: (
|
||||
Option<FunctionDataTypeOrImplicit<'a>>,
|
||||
Option<InterfaceIdentifierOrClassScope<'a>>,
|
||||
FunctionIdentifier<'a>,
|
||||
Paren<'a, Option<TfPortList<'a>>>,
|
||||
Symbol<'a>,
|
||||
Vec<BlockItemDeclaration<'a>>,
|
||||
Vec<FunctionStatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, FunctionIdentifier<'a>)>,
|
||||
Keyword,
|
||||
DataTypeOrVoid,
|
||||
FunctionIdentifier,
|
||||
Option<Paren<Option<TfPortList>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfaceIdentifierOrClassScope<'a> {
|
||||
InterfaceIdentifier((InterfaceIdentifier<'a>, Symbol<'a>)),
|
||||
ClassScope(ClassScope<'a>),
|
||||
pub enum DpiImportExport {
|
||||
ImportFunction(DpiImportExportImportFunction),
|
||||
ImportTask(DpiImportExportImportTask),
|
||||
ExportFunction(DpiImportExportExportFunction),
|
||||
ExportTask(DpiImportExportExportTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionPrototype<'a> {
|
||||
pub struct DpiImportExportImportFunction {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DataTypeOrVoid<'a>,
|
||||
FunctionIdentifier<'a>,
|
||||
Option<Paren<'a, Option<TfPortList<'a>>>>,
|
||||
Keyword,
|
||||
DpiSpecString,
|
||||
Option<DpiFunctionImportProperty>,
|
||||
Option<(CIdentifier, Symbol)>,
|
||||
DpiFunctionProto,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DpiImportExport<'a> {
|
||||
ImportFunction(DpiImportExportImportFunction<'a>),
|
||||
ImportTask(DpiImportExportImportTask<'a>),
|
||||
ExportFunction(DpiImportExportExportFunction<'a>),
|
||||
ExportTask(DpiImportExportExportTask<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiImportExportImportFunction<'a> {
|
||||
pub struct DpiImportExportImportTask {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DpiSpecString<'a>,
|
||||
Option<DpiFunctionImportProperty<'a>>,
|
||||
Option<(CIdentifier<'a>, Symbol<'a>)>,
|
||||
DpiFunctionProto<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
DpiSpecString,
|
||||
Option<DpiTaskImportProperty>,
|
||||
Option<(CIdentifier, Symbol)>,
|
||||
DpiTaskProto,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiImportExportImportTask<'a> {
|
||||
pub struct DpiImportExportExportFunction {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DpiSpecString<'a>,
|
||||
Option<DpiTaskImportProperty<'a>>,
|
||||
Option<(CIdentifier<'a>, Symbol<'a>)>,
|
||||
DpiTaskProto<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
DpiSpecString,
|
||||
Option<(CIdentifier, Symbol)>,
|
||||
Keyword,
|
||||
FunctionIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiImportExportExportFunction<'a> {
|
||||
pub struct DpiImportExportExportTask {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DpiSpecString<'a>,
|
||||
Option<(CIdentifier<'a>, Symbol<'a>)>,
|
||||
Keyword<'a>,
|
||||
FunctionIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
DpiSpecString,
|
||||
Option<(CIdentifier, Symbol)>,
|
||||
Keyword,
|
||||
TaskIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiImportExportExportTask<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DpiSpecString<'a>,
|
||||
Option<(CIdentifier<'a>, Symbol<'a>)>,
|
||||
Keyword<'a>,
|
||||
TaskIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
pub enum DpiSpecString {
|
||||
DpiC(Keyword),
|
||||
Dpi(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DpiSpecString<'a> {
|
||||
DpiC(Keyword<'a>),
|
||||
Dpi(Keyword<'a>),
|
||||
pub enum DpiFunctionImportProperty {
|
||||
Context(Keyword),
|
||||
Pure(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DpiFunctionImportProperty<'a> {
|
||||
Context(Keyword<'a>),
|
||||
Pure(Keyword<'a>),
|
||||
pub enum DpiTaskImportProperty {
|
||||
Context(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DpiTaskImportProperty<'a> {
|
||||
Context(Keyword<'a>),
|
||||
pub struct DpiFunctionProto {
|
||||
pub nodes: (FunctionPrototype,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiFunctionProto<'a> {
|
||||
pub nodes: (FunctionPrototype<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DpiTaskProto<'a> {
|
||||
pub nodes: (TaskPrototype<'a>,),
|
||||
pub struct DpiTaskProto {
|
||||
pub nodes: (TaskPrototype,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,88 +8,81 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, List<Symbol<'a>, ModportItem<'a>>, Symbol<'a>),
|
||||
pub struct ModportDeclaration {
|
||||
pub nodes: (Keyword, List<Symbol, ModportItem>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportItem<'a> {
|
||||
pub struct ModportItem {
|
||||
pub nodes: (
|
||||
ModportIdentifier<'a>,
|
||||
Paren<'a, List<Symbol<'a>, ModportPortsDeclaraton<'a>>>,
|
||||
ModportIdentifier,
|
||||
Paren<List<Symbol, ModportPortsDeclaraton>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModportPortsDeclaraton<'a> {
|
||||
Simple(ModportPortsDeclaratonSimple<'a>),
|
||||
Tf(ModportPortsDeclaratonTf<'a>),
|
||||
Clocking(ModportPortsDeclaratonClocking<'a>),
|
||||
pub enum ModportPortsDeclaraton {
|
||||
Simple(ModportPortsDeclaratonSimple),
|
||||
Tf(ModportPortsDeclaratonTf),
|
||||
Clocking(ModportPortsDeclaratonClocking),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonSimple<'a> {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModportSimplePortsDeclaration<'a>,
|
||||
),
|
||||
pub struct ModportPortsDeclaratonSimple {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportSimplePortsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonTf<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ModportTfPortsDeclaration<'a>),
|
||||
pub struct ModportPortsDeclaratonTf {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportTfPortsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportPortsDeclaratonClocking<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ModportClockingDeclaration<'a>),
|
||||
pub struct ModportPortsDeclaratonClocking {
|
||||
pub nodes: (Vec<AttributeInstance>, ModportClockingDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportClockingDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, ClockingIdentifier<'a>),
|
||||
pub struct ModportClockingDeclaration {
|
||||
pub nodes: (Keyword, ClockingIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportSimplePortsDeclaration<'a> {
|
||||
pub nodes: (PortDirection<'a>, List<Symbol<'a>, ModportSimplePort<'a>>),
|
||||
pub struct ModportSimplePortsDeclaration {
|
||||
pub nodes: (PortDirection, List<Symbol, ModportSimplePort>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModportSimplePort<'a> {
|
||||
Ordered(ModportSimplePortOrdered<'a>),
|
||||
Named(ModportSimplePortNamed<'a>),
|
||||
pub enum ModportSimplePort {
|
||||
Ordered(ModportSimplePortOrdered),
|
||||
Named(ModportSimplePortNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportSimplePortOrdered<'a> {
|
||||
pub nodes: (PortIdentifier<'a>,),
|
||||
pub struct ModportSimplePortOrdered {
|
||||
pub nodes: (PortIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportSimplePortNamed<'a> {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
PortIdentifier<'a>,
|
||||
Paren<'a, Option<Expression<'a>>>,
|
||||
),
|
||||
pub struct ModportSimplePortNamed {
|
||||
pub nodes: (Symbol, PortIdentifier, Paren<Option<Expression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportTfPortsDeclaration<'a> {
|
||||
pub nodes: (ImportExport<'a>, List<Symbol<'a>, ModportTfPort<'a>>),
|
||||
pub struct ModportTfPortsDeclaration {
|
||||
pub nodes: (ImportExport, List<Symbol, ModportTfPort>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModportTfPort<'a> {
|
||||
MethodPrototype(MethodPrototype<'a>),
|
||||
TfIdentifier(TfIdentifier<'a>),
|
||||
pub enum ModportTfPort {
|
||||
MethodPrototype(MethodPrototype),
|
||||
TfIdentifier(TfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImportExport<'a> {
|
||||
Import(Keyword<'a>),
|
||||
Export(Keyword<'a>),
|
||||
pub enum ImportExport {
|
||||
Import(Keyword),
|
||||
Export(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,89 +9,75 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetDeclaration<'a> {
|
||||
pub struct LetDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
LetIdentifier<'a>,
|
||||
Option<Paren<'a, Option<LetPortList<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Expression<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
LetIdentifier,
|
||||
Option<Paren<Option<LetPortList>>>,
|
||||
Symbol,
|
||||
Expression,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct LetIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetPortList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, LetPortItem<'a>>,),
|
||||
pub struct LetPortList {
|
||||
pub nodes: (List<Symbol, LetPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetPortItem<'a> {
|
||||
pub struct LetPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<LetFormalType<'a>>,
|
||||
FormalPortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Option<LetFormalType>,
|
||||
FormalPortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, Expression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LetFormalType<'a> {
|
||||
DataTypeOrImplicit(DataTypeOrImplicit<'a>),
|
||||
Untyped(Keyword<'a>),
|
||||
pub enum LetFormalType {
|
||||
DataTypeOrImplicit(DataTypeOrImplicit),
|
||||
Untyped(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetExpression<'a> {
|
||||
pub struct LetExpression {
|
||||
pub nodes: (
|
||||
Option<PackageScope<'a>>,
|
||||
LetIdentifier<'a>,
|
||||
Option<Paren<'a, Option<LetListOfArguments<'a>>>>,
|
||||
Option<PackageScope>,
|
||||
LetIdentifier,
|
||||
Option<Paren<Option<LetListOfArguments>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LetListOfArguments<'a> {
|
||||
Ordered(LetListOfArgumentsOrdered<'a>),
|
||||
Named(LetListOfArgumentsNamed<'a>),
|
||||
pub enum LetListOfArguments {
|
||||
Ordered(LetListOfArgumentsOrdered),
|
||||
Named(LetListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetListOfArgumentsOrdered<'a> {
|
||||
pub struct LetListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol<'a>, Option<LetActualArg<'a>>>,
|
||||
Vec<(
|
||||
Symbol<'a>,
|
||||
Symbol<'a>,
|
||||
Identifier<'a>,
|
||||
Paren<'a, Option<LetActualArg<'a>>>,
|
||||
)>,
|
||||
List<Symbol, Option<LetActualArg>>,
|
||||
Vec<(Symbol, Symbol, Identifier, Paren<Option<LetActualArg>>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetListOfArgumentsNamed<'a> {
|
||||
pub nodes: (
|
||||
List<
|
||||
Symbol<'a>,
|
||||
(
|
||||
Symbol<'a>,
|
||||
Identifier<'a>,
|
||||
Paren<'a, Option<LetActualArg<'a>>>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
pub struct LetListOfArgumentsNamed {
|
||||
pub nodes: (List<Symbol, (Symbol, Identifier, Paren<Option<LetActualArg>>)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LetActualArg<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct LetActualArg {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,52 +7,52 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LocalParameterDeclaration<'a> {
|
||||
Param(LocalParameterDeclarationParam<'a>),
|
||||
Type(LocalParameterDeclarationType<'a>),
|
||||
pub enum LocalParameterDeclaration {
|
||||
Param(LocalParameterDeclarationParam),
|
||||
Type(LocalParameterDeclarationType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LocalParameterDeclarationParam<'a> {
|
||||
pub struct LocalParameterDeclarationParam {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
ListOfParamAssignments<'a>,
|
||||
Keyword,
|
||||
Option<DataTypeOrImplicit>,
|
||||
ListOfParamAssignments,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LocalParameterDeclarationType<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>),
|
||||
pub struct LocalParameterDeclarationType {
|
||||
pub nodes: (Keyword, Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ParameterDeclaration<'a> {
|
||||
Param(ParameterDeclarationParam<'a>),
|
||||
Type(ParameterDeclarationType<'a>),
|
||||
pub enum ParameterDeclaration {
|
||||
Param(ParameterDeclarationParam),
|
||||
Type(ParameterDeclarationType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterDeclarationParam<'a> {
|
||||
pub struct ParameterDeclarationParam {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
ListOfParamAssignments<'a>,
|
||||
Keyword,
|
||||
Option<DataTypeOrImplicit>,
|
||||
ListOfParamAssignments,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterDeclarationType<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>),
|
||||
pub struct ParameterDeclarationType {
|
||||
pub nodes: (Keyword, Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecparamDeclaration<'a> {
|
||||
pub struct SpecparamDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<PackedDimension<'a>>,
|
||||
ListOfSpecparamAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<PackedDimension>,
|
||||
ListOfSpecparamAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -9,290 +9,278 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CastingType<'a> {
|
||||
SimpleType(Box<SimpleType<'a>>),
|
||||
ConstantPrimary(Box<ConstantPrimary<'a>>),
|
||||
Signing(Box<Signing<'a>>),
|
||||
String(Keyword<'a>),
|
||||
Const(Keyword<'a>),
|
||||
pub enum CastingType {
|
||||
SimpleType(Box<SimpleType>),
|
||||
ConstantPrimary(Box<ConstantPrimary>),
|
||||
Signing(Box<Signing>),
|
||||
String(Keyword),
|
||||
Const(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DataType<'a> {
|
||||
Vector(DataTypeVector<'a>),
|
||||
Atom(DataTypeAtom<'a>),
|
||||
NonIntegerType(NonIntegerType<'a>),
|
||||
StructUnion(Box<DataTypeStructUnion<'a>>),
|
||||
Enum(DataTypeEnum<'a>),
|
||||
String(Keyword<'a>),
|
||||
Chandle(Keyword<'a>),
|
||||
Virtual(DataTypeVirtual<'a>),
|
||||
Type(DataTypeType<'a>),
|
||||
ClassType(ClassType<'a>),
|
||||
Event(Keyword<'a>),
|
||||
PsCovergroupIdentifier(PsCovergroupIdentifier<'a>),
|
||||
TypeReference(Box<TypeReference<'a>>),
|
||||
pub enum DataType {
|
||||
Vector(DataTypeVector),
|
||||
Atom(DataTypeAtom),
|
||||
NonIntegerType(NonIntegerType),
|
||||
StructUnion(Box<DataTypeStructUnion>),
|
||||
Enum(DataTypeEnum),
|
||||
String(Keyword),
|
||||
Chandle(Keyword),
|
||||
Virtual(DataTypeVirtual),
|
||||
Type(DataTypeType),
|
||||
ClassType(ClassType),
|
||||
Event(Keyword),
|
||||
PsCovergroupIdentifier(PsCovergroupIdentifier),
|
||||
TypeReference(Box<TypeReference>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeVector<'a> {
|
||||
pub struct DataTypeVector {
|
||||
pub nodes: (IntegerVectorType, Option<Signing>, Vec<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeAtom {
|
||||
pub nodes: (IntegerAtomType, Option<Signing>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeStructUnion {
|
||||
pub nodes: (
|
||||
IntegerVectorType<'a>,
|
||||
Option<Signing<'a>>,
|
||||
Vec<PackedDimension<'a>>,
|
||||
StructUnion,
|
||||
Option<(Packed, Option<Signing>)>,
|
||||
Brace<(StructUnionMember, Vec<StructUnionMember>)>,
|
||||
Vec<PackedDimension>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeAtom<'a> {
|
||||
pub nodes: (IntegerAtomType<'a>, Option<Signing<'a>>),
|
||||
pub struct Packed {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeStructUnion<'a> {
|
||||
pub struct DataTypeEnum {
|
||||
pub nodes: (
|
||||
StructUnion<'a>,
|
||||
Option<(Packed<'a>, Option<Signing<'a>>)>,
|
||||
Brace<'a, (StructUnionMember<'a>, Vec<StructUnionMember<'a>>)>,
|
||||
Vec<PackedDimension<'a>>,
|
||||
Keyword,
|
||||
Option<EnumBaseType>,
|
||||
Brace<List<Symbol, EnumNameDeclaration>>,
|
||||
Vec<PackedDimension>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Packed<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeEnum<'a> {
|
||||
pub struct DataTypeVirtual {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<EnumBaseType<'a>>,
|
||||
Brace<'a, List<Symbol<'a>, EnumNameDeclaration<'a>>>,
|
||||
Vec<PackedDimension<'a>>,
|
||||
Keyword,
|
||||
Option<Interface>,
|
||||
InterfaceIdentifier,
|
||||
Option<ParameterValueAssignment>,
|
||||
Option<(Symbol, ModportIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeVirtual<'a> {
|
||||
pub struct Interface {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeType {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Interface<'a>>,
|
||||
InterfaceIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
Option<(Symbol<'a>, ModportIdentifier<'a>)>,
|
||||
Option<PackageScopeOrClassScope>,
|
||||
TypeIdentifier,
|
||||
Vec<PackedDimension>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Interface<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub enum DataTypeOrImplicit {
|
||||
DataType(DataType),
|
||||
ImplicitDataType(ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataTypeType<'a> {
|
||||
pub struct ImplicitDataType {
|
||||
pub nodes: (Option<Signing>, Vec<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EnumBaseType {
|
||||
Atom(EnumBaseTypeAtom),
|
||||
Vector(EnumBaseTypeVector),
|
||||
Type(EnumBaseTypeType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeAtom {
|
||||
pub nodes: (IntegerAtomType, Option<Signing>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeVector {
|
||||
pub nodes: (IntegerVectorType, Option<Signing>, Option<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeType {
|
||||
pub nodes: (TypeIdentifier, Option<PackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumNameDeclaration {
|
||||
pub nodes: (
|
||||
Option<PackageScopeOrClassScope<'a>>,
|
||||
TypeIdentifier<'a>,
|
||||
Vec<PackedDimension<'a>>,
|
||||
EnumIdentifier,
|
||||
Option<Bracket<(IntegralNumber, Option<(Symbol, IntegralNumber)>)>>,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DataTypeOrImplicit<'a> {
|
||||
DataType(DataType<'a>),
|
||||
ImplicitDataType(ImplicitDataType<'a>),
|
||||
pub struct ClassScope {
|
||||
pub nodes: (ClassType, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ImplicitDataType<'a> {
|
||||
pub nodes: (Option<Signing<'a>>, Vec<PackedDimension<'a>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EnumBaseType<'a> {
|
||||
Atom(EnumBaseTypeAtom<'a>),
|
||||
Vector(EnumBaseTypeVector<'a>),
|
||||
Type(EnumBaseTypeType<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeAtom<'a> {
|
||||
pub nodes: (IntegerAtomType<'a>, Option<Signing<'a>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeVector<'a> {
|
||||
pub struct ClassType {
|
||||
pub nodes: (
|
||||
IntegerVectorType<'a>,
|
||||
Option<Signing<'a>>,
|
||||
Option<PackedDimension<'a>>,
|
||||
PsClassIdentifier,
|
||||
Option<ParameterValueAssignment>,
|
||||
Vec<(Symbol, ClassIdentifier, Option<ParameterValueAssignment>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumBaseTypeType<'a> {
|
||||
pub nodes: (TypeIdentifier<'a>, Option<PackedDimension<'a>>),
|
||||
pub enum IntegerType {
|
||||
IntegerVectorType(IntegerVectorType),
|
||||
IntegerAtomType(IntegerAtomType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumNameDeclaration<'a> {
|
||||
pub enum IntegerAtomType {
|
||||
Byte(Keyword),
|
||||
Shortint(Keyword),
|
||||
Int(Keyword),
|
||||
Longint(Keyword),
|
||||
Integer(Keyword),
|
||||
Time(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IntegerVectorType {
|
||||
Bit(Keyword),
|
||||
Logic(Keyword),
|
||||
Reg(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NonIntegerType {
|
||||
Shortreal(Keyword),
|
||||
Real(Keyword),
|
||||
Realtime(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetType {
|
||||
Supply0(Keyword),
|
||||
Supply1(Keyword),
|
||||
Tri(Keyword),
|
||||
Triand(Keyword),
|
||||
Trior(Keyword),
|
||||
Trireg(Keyword),
|
||||
Tri0(Keyword),
|
||||
Tri1(Keyword),
|
||||
Uwire(Keyword),
|
||||
Wire(Keyword),
|
||||
Wand(Keyword),
|
||||
Wor(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetPortType {
|
||||
DataType(NetPortTypeDataType),
|
||||
NetTypeIdentifier(NetTypeIdentifier),
|
||||
Interconnect(NetPortTypeInterconnect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetPortTypeDataType {
|
||||
pub nodes: (Option<NetType>, DataTypeOrImplicit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetPortTypeInterconnect {
|
||||
pub nodes: (Keyword, ImplicitDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariablePortType {
|
||||
pub nodes: (VarDataType,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VarDataType {
|
||||
DataType(DataType),
|
||||
Var(VarDataTypeVar),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VarDataTypeVar {
|
||||
pub nodes: (Keyword, DataTypeOrImplicit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Signing {
|
||||
Signed(Keyword),
|
||||
Unsigned(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SimpleType {
|
||||
IntegerType(IntegerType),
|
||||
NonIntegerType(NonIntegerType),
|
||||
PsTypeIdentifier(PsTypeIdentifier),
|
||||
PsParameterIdentifier(PsParameterIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StructUnionMember {
|
||||
pub nodes: (
|
||||
EnumIdentifier<'a>,
|
||||
Option<Bracket<'a, (IntegralNumber<'a>, Option<(Symbol<'a>, IntegralNumber<'a>)>)>>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Option<RandomQualifier>,
|
||||
DataTypeOrVoid,
|
||||
ListOfVariableDeclAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassScope<'a> {
|
||||
pub nodes: (ClassType<'a>, Symbol<'a>),
|
||||
pub enum DataTypeOrVoid {
|
||||
DataType(DataType),
|
||||
Void(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassType<'a> {
|
||||
pub nodes: (
|
||||
PsClassIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
Vec<(
|
||||
Symbol<'a>,
|
||||
ClassIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
)>,
|
||||
),
|
||||
pub enum StructUnion {
|
||||
Struct(Keyword),
|
||||
Union(Keyword),
|
||||
UnionTagged((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IntegerType<'a> {
|
||||
IntegerVectorType(IntegerVectorType<'a>),
|
||||
IntegerAtomType(IntegerAtomType<'a>),
|
||||
pub enum TypeReference {
|
||||
Expression(TypeReferenceExpression),
|
||||
DataType(TypeReferenceDataType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IntegerAtomType<'a> {
|
||||
Byte(Keyword<'a>),
|
||||
Shortint(Keyword<'a>),
|
||||
Int(Keyword<'a>),
|
||||
Longint(Keyword<'a>),
|
||||
Integer(Keyword<'a>),
|
||||
Time(Keyword<'a>),
|
||||
pub struct TypeReferenceExpression {
|
||||
pub nodes: (Keyword, Paren<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IntegerVectorType<'a> {
|
||||
Bit(Keyword<'a>),
|
||||
Logic(Keyword<'a>),
|
||||
Reg(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NonIntegerType<'a> {
|
||||
Shortreal(Keyword<'a>),
|
||||
Real(Keyword<'a>),
|
||||
Realtime(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetType<'a> {
|
||||
Supply0(Keyword<'a>),
|
||||
Supply1(Keyword<'a>),
|
||||
Tri(Keyword<'a>),
|
||||
Triand(Keyword<'a>),
|
||||
Trior(Keyword<'a>),
|
||||
Trireg(Keyword<'a>),
|
||||
Tri0(Keyword<'a>),
|
||||
Tri1(Keyword<'a>),
|
||||
Uwire(Keyword<'a>),
|
||||
Wire(Keyword<'a>),
|
||||
Wand(Keyword<'a>),
|
||||
Wor(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetPortType<'a> {
|
||||
DataType(NetPortTypeDataType<'a>),
|
||||
NetTypeIdentifier(NetTypeIdentifier<'a>),
|
||||
Interconnect(NetPortTypeInterconnect<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetPortTypeDataType<'a> {
|
||||
pub nodes: (Option<NetType<'a>>, DataTypeOrImplicit<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetPortTypeInterconnect<'a> {
|
||||
pub nodes: (Keyword<'a>, ImplicitDataType<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariablePortType<'a> {
|
||||
pub nodes: (VarDataType<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VarDataType<'a> {
|
||||
DataType(DataType<'a>),
|
||||
Var(VarDataTypeVar<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VarDataTypeVar<'a> {
|
||||
pub nodes: (Keyword<'a>, DataTypeOrImplicit<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Signing<'a> {
|
||||
Signed(Keyword<'a>),
|
||||
Unsigned(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SimpleType<'a> {
|
||||
IntegerType(IntegerType<'a>),
|
||||
NonIntegerType(NonIntegerType<'a>),
|
||||
PsTypeIdentifier(PsTypeIdentifier<'a>),
|
||||
PsParameterIdentifier(PsParameterIdentifier<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StructUnionMember<'a> {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<RandomQualifier<'a>>,
|
||||
DataTypeOrVoid<'a>,
|
||||
ListOfVariableDeclAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DataTypeOrVoid<'a> {
|
||||
DataType(DataType<'a>),
|
||||
Void(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StructUnion<'a> {
|
||||
Struct(Keyword<'a>),
|
||||
Union(Keyword<'a>),
|
||||
UnionTagged((Keyword<'a>, Keyword<'a>)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TypeReference<'a> {
|
||||
Expression(TypeReferenceExpression<'a>),
|
||||
DataType(TypeReferenceDataType<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeReferenceExpression<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeReferenceDataType<'a> {
|
||||
pub nodes: (Keyword<'a>, Paren<'a, DataType<'a>>),
|
||||
pub struct TypeReferenceDataType {
|
||||
pub nodes: (Keyword, Paren<DataType>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,77 +8,77 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InoutDeclaration<'a> {
|
||||
pub struct InoutDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<NetPortType<'a>>,
|
||||
ListOfPortIdentifiers<'a>,
|
||||
Keyword,
|
||||
Option<NetPortType>,
|
||||
ListOfPortIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InputDeclaration<'a> {
|
||||
Net(InputDeclarationNet<'a>),
|
||||
Variable(InputDeclarationVariable<'a>),
|
||||
pub enum InputDeclaration {
|
||||
Net(InputDeclarationNet),
|
||||
Variable(InputDeclarationVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InputDeclarationNet<'a> {
|
||||
pub struct InputDeclarationNet {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<NetPortType<'a>>,
|
||||
ListOfPortIdentifiers<'a>,
|
||||
Keyword,
|
||||
Option<NetPortType>,
|
||||
ListOfPortIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InputDeclarationVariable<'a> {
|
||||
pub struct InputDeclarationVariable {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
VariablePortType<'a>,
|
||||
ListOfVariableIdentifiers<'a>,
|
||||
Keyword,
|
||||
VariablePortType,
|
||||
ListOfVariableIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum OutputDeclaration<'a> {
|
||||
Net(OutputDeclarationNet<'a>),
|
||||
Variable(OutputDeclarationVariable<'a>),
|
||||
pub enum OutputDeclaration {
|
||||
Net(OutputDeclarationNet),
|
||||
Variable(OutputDeclarationVariable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputDeclarationNet<'a> {
|
||||
pub struct OutputDeclarationNet {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<NetPortType<'a>>,
|
||||
ListOfPortIdentifiers<'a>,
|
||||
Keyword,
|
||||
Option<NetPortType>,
|
||||
ListOfPortIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputDeclarationVariable<'a> {
|
||||
pub struct OutputDeclarationVariable {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
VariablePortType<'a>,
|
||||
ListOfVariableIdentifiers<'a>,
|
||||
Keyword,
|
||||
VariablePortType,
|
||||
ListOfVariableIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfacePortDeclaration<'a> {
|
||||
pub struct InterfacePortDeclaration {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier<'a>,
|
||||
Option<(Symbol<'a>, ModportIdentifier<'a>)>,
|
||||
ListOfInterfaceIdentifiers<'a>,
|
||||
InterfaceIdentifier,
|
||||
Option<(Symbol, ModportIdentifier)>,
|
||||
ListOfInterfaceIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RefDeclaration<'a> {
|
||||
pub struct RefDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
VariablePortType<'a>,
|
||||
ListOfVariableIdentifiers<'a>,
|
||||
Keyword,
|
||||
VariablePortType,
|
||||
ListOfVariableIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -7,81 +7,81 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DriveStrength<'a> {
|
||||
Strength01(DriveStrength01<'a>),
|
||||
Strength10(DriveStrength10<'a>),
|
||||
Strength0z(DriveStrength0z<'a>),
|
||||
Strength1z(DriveStrength1z<'a>),
|
||||
Strengthz0(DriveStrengthz0<'a>),
|
||||
Strengthz1(DriveStrengthz1<'a>),
|
||||
pub enum DriveStrength {
|
||||
Strength01(DriveStrength01),
|
||||
Strength10(DriveStrength10),
|
||||
Strength0z(DriveStrength0z),
|
||||
Strength1z(DriveStrength1z),
|
||||
Strengthz0(DriveStrengthz0),
|
||||
Strengthz1(DriveStrengthz1),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrength01<'a> {
|
||||
pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,),
|
||||
pub struct DriveStrength01 {
|
||||
pub nodes: (Paren<(Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrength10<'a> {
|
||||
pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,),
|
||||
pub struct DriveStrength10 {
|
||||
pub nodes: (Paren<(Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrength0z<'a> {
|
||||
pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Keyword<'a>)>,),
|
||||
pub struct DriveStrength0z {
|
||||
pub nodes: (Paren<(Strength0, Symbol, Keyword)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrength1z<'a> {
|
||||
pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Keyword<'a>)>,),
|
||||
pub struct DriveStrength1z {
|
||||
pub nodes: (Paren<(Strength1, Symbol, Keyword)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrengthz1<'a> {
|
||||
pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength1<'a>)>,),
|
||||
pub struct DriveStrengthz1 {
|
||||
pub nodes: (Paren<(Keyword, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DriveStrengthz0<'a> {
|
||||
pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength0<'a>)>,),
|
||||
pub struct DriveStrengthz0 {
|
||||
pub nodes: (Paren<(Keyword, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Strength0<'a> {
|
||||
Supply0(Keyword<'a>),
|
||||
Strong0(Keyword<'a>),
|
||||
Pull0(Keyword<'a>),
|
||||
Weak0(Keyword<'a>),
|
||||
pub enum Strength0 {
|
||||
Supply0(Keyword),
|
||||
Strong0(Keyword),
|
||||
Pull0(Keyword),
|
||||
Weak0(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Strength1<'a> {
|
||||
Supply1(Keyword<'a>),
|
||||
Strong1(Keyword<'a>),
|
||||
Pull1(Keyword<'a>),
|
||||
Weak1(Keyword<'a>),
|
||||
pub enum Strength1 {
|
||||
Supply1(Keyword),
|
||||
Strong1(Keyword),
|
||||
Pull1(Keyword),
|
||||
Weak1(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ChargeStrength<'a> {
|
||||
Small(ChargeStrengthSmall<'a>),
|
||||
Medium(ChargeStrengthMedium<'a>),
|
||||
Large(ChargeStrengthLarge<'a>),
|
||||
pub enum ChargeStrength {
|
||||
Small(ChargeStrengthSmall),
|
||||
Medium(ChargeStrengthMedium),
|
||||
Large(ChargeStrengthLarge),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ChargeStrengthSmall<'a> {
|
||||
pub nodes: (Paren<'a, Keyword<'a>>,),
|
||||
pub struct ChargeStrengthSmall {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ChargeStrengthMedium<'a> {
|
||||
pub nodes: (Paren<'a, Keyword<'a>>,),
|
||||
pub struct ChargeStrengthMedium {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ChargeStrengthLarge<'a> {
|
||||
pub nodes: (Paren<'a, Keyword<'a>>,),
|
||||
pub struct ChargeStrengthLarge {
|
||||
pub nodes: (Paren<Keyword>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,94 +9,90 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaskDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<Lifetime<'a>>, TaskBodyDeclaration<'a>),
|
||||
pub struct TaskDeclaration {
|
||||
pub nodes: (Keyword, Option<Lifetime>, TaskBodyDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TaskBodyDeclaration<'a> {
|
||||
WithoutPort(TaskBodyDeclarationWithoutPort<'a>),
|
||||
WithPort(TaskBodyDeclarationWithPort<'a>),
|
||||
pub enum TaskBodyDeclaration {
|
||||
WithoutPort(TaskBodyDeclarationWithoutPort),
|
||||
WithPort(TaskBodyDeclarationWithPort),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaskBodyDeclarationWithoutPort<'a> {
|
||||
pub struct TaskBodyDeclarationWithoutPort {
|
||||
pub nodes: (
|
||||
Option<InterfaceIdentifierOrClassScope<'a>>,
|
||||
TaskIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<TfItemDeclaration<'a>>,
|
||||
Vec<StatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, TaskIdentifier<'a>)>,
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
TaskIdentifier,
|
||||
Symbol,
|
||||
Vec<TfItemDeclaration>,
|
||||
Vec<StatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, TaskIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaskBodyDeclarationWithPort<'a> {
|
||||
pub struct TaskBodyDeclarationWithPort {
|
||||
pub nodes: (
|
||||
Option<InterfaceIdentifierOrClassScope<'a>>,
|
||||
TaskIdentifier<'a>,
|
||||
Paren<'a, Option<TfPortList<'a>>>,
|
||||
Symbol<'a>,
|
||||
Vec<BlockItemDeclaration<'a>>,
|
||||
Vec<StatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, TaskIdentifier<'a>)>,
|
||||
Option<InterfaceIdentifierOrClassScope>,
|
||||
TaskIdentifier,
|
||||
Paren<Option<TfPortList>>,
|
||||
Symbol,
|
||||
Vec<BlockItemDeclaration>,
|
||||
Vec<StatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, TaskIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TfItemDeclaration<'a> {
|
||||
BlockItemDeclaration(BlockItemDeclaration<'a>),
|
||||
TfPortDeclaration(TfPortDeclaration<'a>),
|
||||
pub enum TfItemDeclaration {
|
||||
BlockItemDeclaration(BlockItemDeclaration),
|
||||
TfPortDeclaration(TfPortDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TfPortList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, TfPortItem<'a>>,),
|
||||
pub struct TfPortList {
|
||||
pub nodes: (List<Symbol, TfPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TfPortItem<'a> {
|
||||
pub struct TfPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<TfPortDirection<'a>>,
|
||||
Option<Var<'a>>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
Vec<AttributeInstance>,
|
||||
Option<TfPortDirection>,
|
||||
Option<Var>,
|
||||
Option<DataTypeOrImplicit>,
|
||||
Option<(
|
||||
PortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, Expression<'a>)>,
|
||||
PortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, Expression)>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TfPortDirection<'a> {
|
||||
PortDirection(PortDirection<'a>),
|
||||
ConstRef((Keyword<'a>, Keyword<'a>)),
|
||||
pub enum TfPortDirection {
|
||||
PortDirection(PortDirection),
|
||||
ConstRef((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TfPortDeclaration<'a> {
|
||||
pub struct TfPortDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
TfPortDirection<'a>,
|
||||
Option<Var<'a>>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
ListOfTfVariableIdentifiers<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
TfPortDirection,
|
||||
Option<Var>,
|
||||
Option<DataTypeOrImplicit>,
|
||||
ListOfTfVariableIdentifiers,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaskPrototype<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
TaskIdentifier<'a>,
|
||||
Option<Paren<'a, Option<TfPortList<'a>>>>,
|
||||
),
|
||||
pub struct TaskPrototype {
|
||||
pub nodes: (Keyword, TaskIdentifier, Option<Paren<Option<TfPortList>>>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,221 +9,221 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DataDeclaration<'a> {
|
||||
Variable(DataDeclarationVariable<'a>),
|
||||
TypeDeclaration(TypeDeclaration<'a>),
|
||||
PackageImportDeclaration(PackageImportDeclaration<'a>),
|
||||
NetTypeDeclaration(NetTypeDeclaration<'a>),
|
||||
pub enum DataDeclaration {
|
||||
Variable(DataDeclarationVariable),
|
||||
TypeDeclaration(TypeDeclaration),
|
||||
PackageImportDeclaration(PackageImportDeclaration),
|
||||
NetTypeDeclaration(NetTypeDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataDeclarationVariable<'a> {
|
||||
pub struct DataDeclarationVariable {
|
||||
pub nodes: (
|
||||
Option<Const<'a>>,
|
||||
Option<Var<'a>>,
|
||||
Option<Lifetime<'a>>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
ListOfVariableDeclAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
Option<Const>,
|
||||
Option<Var>,
|
||||
Option<Lifetime>,
|
||||
Option<DataTypeOrImplicit>,
|
||||
ListOfVariableDeclAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Const<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Const {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageImportDeclaration<'a> {
|
||||
pub struct PackageImportDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
List<Symbol<'a>, PackageImportItem<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
List<Symbol, PackageImportItem>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageImportItem<'a> {
|
||||
Identifier(PackageImportItemIdentifier<'a>),
|
||||
Asterisk(PackageImportItemAsterisk<'a>),
|
||||
pub enum PackageImportItem {
|
||||
Identifier(PackageImportItemIdentifier),
|
||||
Asterisk(PackageImportItemAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageImportItemIdentifier<'a> {
|
||||
pub nodes: (PackageIdentifier<'a>, Symbol<'a>, Identifier<'a>),
|
||||
pub struct PackageImportItemIdentifier {
|
||||
pub nodes: (PackageIdentifier, Symbol, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageImportItemAsterisk<'a> {
|
||||
pub nodes: (PackageIdentifier<'a>, Symbol<'a>, Symbol<'a>),
|
||||
pub struct PackageImportItemAsterisk {
|
||||
pub nodes: (PackageIdentifier, Symbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageExportDeclaration<'a> {
|
||||
Asterisk(PackageExportDeclarationAsterisk<'a>),
|
||||
Item(PackageExportDeclarationItem<'a>),
|
||||
pub enum PackageExportDeclaration {
|
||||
Asterisk(PackageExportDeclarationAsterisk),
|
||||
Item(PackageExportDeclarationItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageExportDeclarationAsterisk<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>, Symbol<'a>),
|
||||
pub struct PackageExportDeclarationAsterisk {
|
||||
pub nodes: (Keyword, Symbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageExportDeclarationItem<'a> {
|
||||
pub struct PackageExportDeclarationItem {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
List<Symbol<'a>, PackageImportItem<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
List<Symbol, PackageImportItem>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, ListOfGenvarIdentifiers<'a>, Symbol<'a>),
|
||||
pub struct GenvarDeclaration {
|
||||
pub nodes: (Keyword, ListOfGenvarIdentifiers, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetDeclaration<'a> {
|
||||
NetType(NetDeclarationNetType<'a>),
|
||||
NetTypeIdentifier(NetDeclarationNetTypeIdentifier<'a>),
|
||||
Interconnect(NetDeclarationInterconnect<'a>),
|
||||
pub enum NetDeclaration {
|
||||
NetType(NetDeclarationNetType),
|
||||
NetTypeIdentifier(NetDeclarationNetTypeIdentifier),
|
||||
Interconnect(NetDeclarationInterconnect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetDeclarationNetType<'a> {
|
||||
pub struct NetDeclarationNetType {
|
||||
pub nodes: (
|
||||
NetType<'a>,
|
||||
Option<Strength<'a>>,
|
||||
Option<VectorScalar<'a>>,
|
||||
Option<DataTypeOrImplicit<'a>>,
|
||||
Option<Delay3<'a>>,
|
||||
ListOfNetDeclAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
NetType,
|
||||
Option<Strength>,
|
||||
Option<VectorScalar>,
|
||||
Option<DataTypeOrImplicit>,
|
||||
Option<Delay3>,
|
||||
ListOfNetDeclAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Strength<'a> {
|
||||
Drive(DriveStrength<'a>),
|
||||
Charge(ChargeStrength<'a>),
|
||||
pub enum Strength {
|
||||
Drive(DriveStrength),
|
||||
Charge(ChargeStrength),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VectorScalar<'a> {
|
||||
Vectored(Keyword<'a>),
|
||||
Scalared(Keyword<'a>),
|
||||
pub enum VectorScalar {
|
||||
Vectored(Keyword),
|
||||
Scalared(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetDeclarationNetTypeIdentifier<'a> {
|
||||
pub struct NetDeclarationNetTypeIdentifier {
|
||||
pub nodes: (
|
||||
NetTypeIdentifier<'a>,
|
||||
Option<DelayControl<'a>>,
|
||||
ListOfNetDeclAssignments<'a>,
|
||||
Symbol<'a>,
|
||||
NetTypeIdentifier,
|
||||
Option<DelayControl>,
|
||||
ListOfNetDeclAssignments,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetDeclarationInterconnect<'a> {
|
||||
pub struct NetDeclarationInterconnect {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
ImplicitDataType<'a>,
|
||||
Option<(Symbol<'a>, DelayValue<'a>)>,
|
||||
NetIdentifier<'a>,
|
||||
Vec<UnpackedDimension<'a>>,
|
||||
Option<(Symbol<'a>, NetIdentifier<'a>, Vec<UnpackedDimension<'a>>)>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
ImplicitDataType,
|
||||
Option<(Symbol, DelayValue)>,
|
||||
NetIdentifier,
|
||||
Vec<UnpackedDimension>,
|
||||
Option<(Symbol, NetIdentifier, Vec<UnpackedDimension>)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TypeDeclaration<'a> {
|
||||
DataType(TypeDeclarationDataType<'a>),
|
||||
Interface(TypeDeclarationInterface<'a>),
|
||||
Reserved(TypeDeclarationReserved<'a>),
|
||||
pub enum TypeDeclaration {
|
||||
DataType(TypeDeclarationDataType),
|
||||
Interface(TypeDeclarationInterface),
|
||||
Reserved(TypeDeclarationReserved),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeDeclarationDataType<'a> {
|
||||
pub struct TypeDeclarationDataType {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DataType<'a>,
|
||||
TypeIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
DataType,
|
||||
TypeIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeDeclarationInterface<'a> {
|
||||
pub struct TypeDeclarationInterface {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
InterfaceInstanceIdentifier<'a>,
|
||||
ConstantBitSelect<'a>,
|
||||
Symbol<'a>,
|
||||
TypeIdentifier<'a>,
|
||||
TypeIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
InterfaceInstanceIdentifier,
|
||||
ConstantBitSelect,
|
||||
Symbol,
|
||||
TypeIdentifier,
|
||||
TypeIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeDeclarationReserved<'a> {
|
||||
pub struct TypeDeclarationReserved {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<TypeDeclarationKeyword<'a>>,
|
||||
TypeIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<TypeDeclarationKeyword>,
|
||||
TypeIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TypeDeclarationKeyword<'a> {
|
||||
Enum(Keyword<'a>),
|
||||
Struct(Keyword<'a>),
|
||||
Union(Keyword<'a>),
|
||||
Class(Keyword<'a>),
|
||||
InterfaceClass((Keyword<'a>, Keyword<'a>)),
|
||||
pub enum TypeDeclarationKeyword {
|
||||
Enum(Keyword),
|
||||
Struct(Keyword),
|
||||
Union(Keyword),
|
||||
Class(Keyword),
|
||||
InterfaceClass((Keyword, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetTypeDeclaration<'a> {
|
||||
DataType(NetTypeDeclarationDataType<'a>),
|
||||
NetType(NetTypeDeclarationNetType<'a>),
|
||||
pub enum NetTypeDeclaration {
|
||||
DataType(NetTypeDeclarationDataType),
|
||||
NetType(NetTypeDeclarationNetType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetTypeDeclarationDataType<'a> {
|
||||
pub struct NetTypeDeclarationDataType {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
DataType<'a>,
|
||||
NetTypeIdentifier<'a>,
|
||||
Keyword,
|
||||
DataType,
|
||||
NetTypeIdentifier,
|
||||
Option<(
|
||||
Keyword<'a>,
|
||||
Option<PackageScopeOrClassScope<'a>>,
|
||||
TfIdentifier<'a>,
|
||||
Keyword,
|
||||
Option<PackageScopeOrClassScope>,
|
||||
TfIdentifier,
|
||||
)>,
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetTypeDeclarationNetType<'a> {
|
||||
pub struct NetTypeDeclarationNetType {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<PackageScopeOrClassScope<'a>>,
|
||||
NetTypeIdentifier<'a>,
|
||||
NetTypeIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<PackageScopeOrClassScope>,
|
||||
NetTypeIdentifier,
|
||||
NetTypeIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Lifetime<'a> {
|
||||
Static(Keyword<'a>),
|
||||
Automatic(Keyword<'a>),
|
||||
pub enum Lifetime {
|
||||
Static(Keyword),
|
||||
Automatic(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,99 +8,99 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Concatenation<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, Expression<'a>>>,),
|
||||
pub struct Concatenation {
|
||||
pub nodes: (Brace< List<Symbol, Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, ConstantExpression<'a>>>,),
|
||||
pub struct ConstantConcatenation {
|
||||
pub nodes: (Brace< List<Symbol, ConstantExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantMultipleConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, (ConstantExpression<'a>, ConstantConcatenation<'a>)>,),
|
||||
pub struct ConstantMultipleConcatenation {
|
||||
pub nodes: (Brace< (ConstantExpression, ConstantConcatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, ModulePathExpression<'a>>>,),
|
||||
pub struct ModulePathConcatenation {
|
||||
pub nodes: (Brace< List<Symbol, ModulePathExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathMultipleConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, (ConstantExpression<'a>, ModulePathConcatenation<'a>)>,),
|
||||
pub struct ModulePathMultipleConcatenation {
|
||||
pub nodes: (Brace< (ConstantExpression, ModulePathConcatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MultipleConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, (Expression<'a>, Concatenation<'a>)>,),
|
||||
pub struct MultipleConcatenation {
|
||||
pub nodes: (Brace< (Expression, Concatenation)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StreamingConcatenation<'a> {
|
||||
pub struct StreamingConcatenation {
|
||||
pub nodes: (
|
||||
Brace<
|
||||
'a,
|
||||
|
||||
(
|
||||
StreamOperator<'a>,
|
||||
Option<SliceSize<'a>>,
|
||||
StreamConcatenation<'a>,
|
||||
StreamOperator,
|
||||
Option<SliceSize>,
|
||||
StreamConcatenation,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StreamOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct StreamOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SliceSize<'a> {
|
||||
SimpleType(SimpleType<'a>),
|
||||
ConstantExpression(ConstantExpression<'a>),
|
||||
pub enum SliceSize {
|
||||
SimpleType(SimpleType),
|
||||
ConstantExpression(ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StreamConcatenation<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, StreamExpression<'a>>>,),
|
||||
pub struct StreamConcatenation {
|
||||
pub nodes: (Brace< List<Symbol, StreamExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StreamExpression<'a> {
|
||||
pub struct StreamExpression {
|
||||
pub nodes: (
|
||||
Expression<'a>,
|
||||
Option<(Keyword<'a>, Bracket<'a, ArrayRangeExpression<'a>>)>,
|
||||
Expression,
|
||||
Option<(Keyword, Bracket< ArrayRangeExpression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ArrayRangeExpression<'a> {
|
||||
Expression(Expression<'a>),
|
||||
Colon(ArrayRangeExpressionColon<'a>),
|
||||
PlusColon(ArrayRangeExpressionPlusColon<'a>),
|
||||
MinusColon(ArrayRangeExpressionMinusColon<'a>),
|
||||
pub enum ArrayRangeExpression {
|
||||
Expression(Expression),
|
||||
Colon(ArrayRangeExpressionColon),
|
||||
PlusColon(ArrayRangeExpressionPlusColon),
|
||||
MinusColon(ArrayRangeExpressionMinusColon),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ArrayRangeExpressionColon<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
|
||||
pub struct ArrayRangeExpressionColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ArrayRangeExpressionPlusColon<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
|
||||
pub struct ArrayRangeExpressionPlusColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ArrayRangeExpressionMinusColon<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
|
||||
pub struct ArrayRangeExpressionMinusColon {
|
||||
pub nodes: (Expression, Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EmptyUnpackedArrayConcatenation<'a> {
|
||||
pub nodes: (Symbol<'a>, Symbol<'a>),
|
||||
pub struct EmptyUnpackedArrayConcatenation {
|
||||
pub nodes: (Symbol, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,66 +7,66 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetLvalue<'a> {
|
||||
Identifier(NetLvalueIdentifier<'a>),
|
||||
Lvalue(Box<NetLvalueLvalue<'a>>),
|
||||
Pattern(Box<NetLvaluePattern<'a>>),
|
||||
pub enum NetLvalue {
|
||||
Identifier(NetLvalueIdentifier),
|
||||
Lvalue(Box<NetLvalueLvalue>),
|
||||
Pattern(Box<NetLvaluePattern>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetLvalueIdentifier<'a> {
|
||||
pub nodes: (PsOrHierarchicalNetIdentifier<'a>, ConstantSelect<'a>),
|
||||
pub struct NetLvalueIdentifier {
|
||||
pub nodes: (PsOrHierarchicalNetIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetLvalueLvalue<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, NetLvalue<'a>>>,),
|
||||
pub struct NetLvalueLvalue {
|
||||
pub nodes: (Brace<List<Symbol, NetLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetLvaluePattern<'a> {
|
||||
pub struct NetLvaluePattern {
|
||||
pub nodes: (
|
||||
Option<AssignmentPatternExpressionType<'a>>,
|
||||
AssignmentPatternNetLvalue<'a>,
|
||||
Option<AssignmentPatternExpressionType>,
|
||||
AssignmentPatternNetLvalue,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VariableLvalue<'a> {
|
||||
Identifier(VariableLvalueIdentifier<'a>),
|
||||
Lvalue(Box<VariableLvalueLvalue<'a>>),
|
||||
Pattern(Box<VariableLvaluePattern<'a>>),
|
||||
StreamingConcatenation(StreamingConcatenation<'a>),
|
||||
pub enum VariableLvalue {
|
||||
Identifier(VariableLvalueIdentifier),
|
||||
Lvalue(Box<VariableLvalueLvalue>),
|
||||
Pattern(Box<VariableLvaluePattern>),
|
||||
StreamingConcatenation(StreamingConcatenation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableLvalueIdentifier<'a> {
|
||||
pub struct VariableLvalueIdentifier {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrPackageScope<'a>>,
|
||||
HierarchicalVariableIdentifier<'a>,
|
||||
Select<'a>,
|
||||
Option<ImplicitClassHandleOrPackageScope>,
|
||||
HierarchicalVariableIdentifier,
|
||||
Select,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableLvalueLvalue<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, VariableLvalue<'a>>>,),
|
||||
pub struct VariableLvalueLvalue {
|
||||
pub nodes: (Brace<List<Symbol, VariableLvalue>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableLvaluePattern<'a> {
|
||||
pub struct VariableLvaluePattern {
|
||||
pub nodes: (
|
||||
Option<AssignmentPatternExpressionType<'a>>,
|
||||
AssignmentPatternVariableLvalue<'a>,
|
||||
Option<AssignmentPatternExpressionType>,
|
||||
AssignmentPatternVariableLvalue,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonrangeVariableLvalue<'a> {
|
||||
pub struct NonrangeVariableLvalue {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrPackageScope<'a>>,
|
||||
HierarchicalVariableIdentifier<'a>,
|
||||
NonrangeSelect<'a>,
|
||||
Option<ImplicitClassHandleOrPackageScope>,
|
||||
HierarchicalVariableIdentifier,
|
||||
NonrangeSelect,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -8,273 +8,273 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IncOrDecExpression<'a> {
|
||||
Prefix(IncOrDecExpressionPrefix<'a>),
|
||||
Suffix(IncOrDecExpressionSuffix<'a>),
|
||||
pub enum IncOrDecExpression {
|
||||
Prefix(IncOrDecExpressionPrefix),
|
||||
Suffix(IncOrDecExpressionSuffix),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IncOrDecExpressionPrefix<'a> {
|
||||
pub struct IncOrDecExpressionPrefix {
|
||||
pub nodes: (
|
||||
IncOrDecOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
VariableLvalue<'a>,
|
||||
IncOrDecOperator,
|
||||
Vec<AttributeInstance>,
|
||||
VariableLvalue,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IncOrDecExpressionSuffix<'a> {
|
||||
pub struct IncOrDecExpressionSuffix {
|
||||
pub nodes: (
|
||||
VariableLvalue<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
IncOrDecOperator<'a>,
|
||||
VariableLvalue,
|
||||
Vec<AttributeInstance>,
|
||||
IncOrDecOperator,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConditionalExpression<'a> {
|
||||
pub struct ConditionalExpression {
|
||||
pub nodes: (
|
||||
CondPredicate<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Expression<'a>,
|
||||
Symbol<'a>,
|
||||
Expression<'a>,
|
||||
CondPredicate,
|
||||
Symbol,
|
||||
Vec<AttributeInstance>,
|
||||
Expression,
|
||||
Symbol,
|
||||
Expression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantExpression<'a> {
|
||||
ConstantPrimary(Box<ConstantPrimary<'a>>),
|
||||
Unary(Box<ConstantExpressionUnary<'a>>),
|
||||
Binary(Box<ConstantExpressionBinary<'a>>),
|
||||
Ternary(Box<ConstantExpressionTernary<'a>>),
|
||||
pub enum ConstantExpression {
|
||||
ConstantPrimary(Box<ConstantPrimary>),
|
||||
Unary(Box<ConstantExpressionUnary>),
|
||||
Binary(Box<ConstantExpressionBinary>),
|
||||
Ternary(Box<ConstantExpressionTernary>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantExpressionUnary<'a> {
|
||||
pub struct ConstantExpressionUnary {
|
||||
pub nodes: (
|
||||
UnaryOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ConstantPrimary<'a>,
|
||||
UnaryOperator,
|
||||
Vec<AttributeInstance>,
|
||||
ConstantPrimary,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantExpressionBinary<'a> {
|
||||
pub struct ConstantExpressionBinary {
|
||||
pub nodes: (
|
||||
ConstantExpression<'a>,
|
||||
BinaryOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ConstantExpression<'a>,
|
||||
ConstantExpression,
|
||||
BinaryOperator,
|
||||
Vec<AttributeInstance>,
|
||||
ConstantExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantExpressionTernary<'a> {
|
||||
pub struct ConstantExpressionTernary {
|
||||
pub nodes: (
|
||||
ConstantExpression<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ConstantExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantExpression<'a>,
|
||||
ConstantExpression,
|
||||
Symbol,
|
||||
Vec<AttributeInstance>,
|
||||
ConstantExpression,
|
||||
Symbol,
|
||||
ConstantExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantMintypmaxExpression<'a> {
|
||||
Unary(ConstantExpression<'a>),
|
||||
Ternary(ConstantMintypmaxExpressionTernary<'a>),
|
||||
pub enum ConstantMintypmaxExpression {
|
||||
Unary(ConstantExpression),
|
||||
Ternary(ConstantMintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantMintypmaxExpressionTernary<'a> {
|
||||
pub struct ConstantMintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
ConstantExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantExpression<'a>,
|
||||
ConstantExpression,
|
||||
Symbol,
|
||||
ConstantExpression,
|
||||
Symbol,
|
||||
ConstantExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantParamExpression<'a> {
|
||||
ConstantMintypmaxExpression(ConstantMintypmaxExpression<'a>),
|
||||
DataType(DataType<'a>),
|
||||
Dollar(Symbol<'a>),
|
||||
pub enum ConstantParamExpression {
|
||||
ConstantMintypmaxExpression(ConstantMintypmaxExpression),
|
||||
DataType(DataType),
|
||||
Dollar(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ParamExpression<'a> {
|
||||
MintypmaxExpression(MintypmaxExpression<'a>),
|
||||
DataType(Box<DataType<'a>>),
|
||||
Dollar(Symbol<'a>),
|
||||
pub enum ParamExpression {
|
||||
MintypmaxExpression(MintypmaxExpression),
|
||||
DataType(Box<DataType>),
|
||||
Dollar(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantRangeExpression<'a> {
|
||||
ConstantExpression(ConstantExpression<'a>),
|
||||
ConstantPartSelectRange(ConstantPartSelectRange<'a>),
|
||||
pub enum ConstantRangeExpression {
|
||||
ConstantExpression(ConstantExpression),
|
||||
ConstantPartSelectRange(ConstantPartSelectRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantPartSelectRange<'a> {
|
||||
ConstantRange(ConstantRange<'a>),
|
||||
ConstantIndexedRange(ConstantIndexedRange<'a>),
|
||||
pub enum ConstantPartSelectRange {
|
||||
ConstantRange(ConstantRange),
|
||||
ConstantIndexedRange(ConstantIndexedRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantRange<'a> {
|
||||
pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>),
|
||||
pub struct ConstantRange {
|
||||
pub nodes: (ConstantExpression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantIndexedRange<'a> {
|
||||
pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>),
|
||||
pub struct ConstantIndexedRange {
|
||||
pub nodes: (ConstantExpression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Expression<'a> {
|
||||
Primary(Box<Primary<'a>>),
|
||||
Unary(Box<ExpressionUnary<'a>>),
|
||||
IncOrDecExpression(Box<IncOrDecExpression<'a>>),
|
||||
OperatorAssignment(Box<ExpressionOperatorAssignment<'a>>),
|
||||
Binary(Box<ExpressionBinary<'a>>),
|
||||
ConditionalExpression(Box<ConditionalExpression<'a>>),
|
||||
InsideExpression(Box<InsideExpression<'a>>),
|
||||
TaggedUnionExpression(Box<TaggedUnionExpression<'a>>),
|
||||
pub enum Expression {
|
||||
Primary(Box<Primary>),
|
||||
Unary(Box<ExpressionUnary>),
|
||||
IncOrDecExpression(Box<IncOrDecExpression>),
|
||||
OperatorAssignment(Box<ExpressionOperatorAssignment>),
|
||||
Binary(Box<ExpressionBinary>),
|
||||
ConditionalExpression(Box<ConditionalExpression>),
|
||||
InsideExpression(Box<InsideExpression>),
|
||||
TaggedUnionExpression(Box<TaggedUnionExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExpressionUnary<'a> {
|
||||
pub nodes: (UnaryOperator<'a>, Vec<AttributeInstance<'a>>, Primary<'a>),
|
||||
pub struct ExpressionUnary {
|
||||
pub nodes: (UnaryOperator, Vec<AttributeInstance>, Primary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExpressionOperatorAssignment<'a> {
|
||||
pub nodes: (Paren<'a, OperatorAssignment<'a>>,),
|
||||
pub struct ExpressionOperatorAssignment {
|
||||
pub nodes: (Paren< OperatorAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExpressionBinary<'a> {
|
||||
pub struct ExpressionBinary {
|
||||
pub nodes: (
|
||||
Expression<'a>,
|
||||
BinaryOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Expression<'a>,
|
||||
Expression,
|
||||
BinaryOperator,
|
||||
Vec<AttributeInstance>,
|
||||
Expression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaggedUnionExpression<'a> {
|
||||
pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option<Expression<'a>>),
|
||||
pub struct TaggedUnionExpression {
|
||||
pub nodes: (Keyword, MemberIdentifier, Option<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InsideExpression<'a> {
|
||||
pub nodes: (Expression<'a>, Keyword<'a>, Brace<'a, OpenRangeList<'a>>),
|
||||
pub struct InsideExpression {
|
||||
pub nodes: (Expression, Keyword, Brace< OpenRangeList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ValueRange<'a> {
|
||||
Expression(Expression<'a>),
|
||||
Binary(ValueRangeBinary<'a>),
|
||||
pub enum ValueRange {
|
||||
Expression(Expression),
|
||||
Binary(ValueRangeBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ValueRangeBinary<'a> {
|
||||
pub nodes: (Bracket<'a, (Expression<'a>, Symbol<'a>, Expression<'a>)>,),
|
||||
pub struct ValueRangeBinary {
|
||||
pub nodes: (Bracket< (Expression, Symbol, Expression)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum MintypmaxExpression<'a> {
|
||||
Expression(Expression<'a>),
|
||||
Ternary(MintypmaxExpressionTernary<'a>),
|
||||
pub enum MintypmaxExpression {
|
||||
Expression(Expression),
|
||||
Ternary(MintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MintypmaxExpressionTernary<'a> {
|
||||
pub struct MintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
Expression<'a>,
|
||||
Symbol<'a>,
|
||||
Expression<'a>,
|
||||
Symbol<'a>,
|
||||
Expression<'a>,
|
||||
Expression,
|
||||
Symbol,
|
||||
Expression,
|
||||
Symbol,
|
||||
Expression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathConditionalExpression<'a> {
|
||||
pub struct ModulePathConditionalExpression {
|
||||
pub nodes: (
|
||||
ModulePathExpression<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModulePathExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ModulePathExpression<'a>,
|
||||
ModulePathExpression,
|
||||
Symbol,
|
||||
Vec<AttributeInstance>,
|
||||
ModulePathExpression,
|
||||
Symbol,
|
||||
ModulePathExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModulePathExpression<'a> {
|
||||
ModulePathPrimary(Box<ModulePathPrimary<'a>>),
|
||||
Unary(Box<ModulePathExpressionUnary<'a>>),
|
||||
Binary(Box<ModulePathExpressionBinary<'a>>),
|
||||
ModulePathConditionalExpression(Box<ModulePathConditionalExpression<'a>>),
|
||||
pub enum ModulePathExpression {
|
||||
ModulePathPrimary(Box<ModulePathPrimary>),
|
||||
Unary(Box<ModulePathExpressionUnary>),
|
||||
Binary(Box<ModulePathExpressionBinary>),
|
||||
ModulePathConditionalExpression(Box<ModulePathConditionalExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathExpressionUnary<'a> {
|
||||
pub struct ModulePathExpressionUnary {
|
||||
pub nodes: (
|
||||
UnaryModulePathOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModulePathPrimary<'a>,
|
||||
UnaryModulePathOperator,
|
||||
Vec<AttributeInstance>,
|
||||
ModulePathPrimary,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathExpressionBinary<'a> {
|
||||
pub struct ModulePathExpressionBinary {
|
||||
pub nodes: (
|
||||
ModulePathExpression<'a>,
|
||||
BinaryModulePathOperator<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModulePathExpression<'a>,
|
||||
ModulePathExpression,
|
||||
BinaryModulePathOperator,
|
||||
Vec<AttributeInstance>,
|
||||
ModulePathExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModulePathMintypmaxExpression<'a> {
|
||||
ModulePathExpression(ModulePathExpression<'a>),
|
||||
Ternary(ModulePathMintypmaxExpressionTernary<'a>),
|
||||
pub enum ModulePathMintypmaxExpression {
|
||||
ModulePathExpression(ModulePathExpression),
|
||||
Ternary(ModulePathMintypmaxExpressionTernary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathMintypmaxExpressionTernary<'a> {
|
||||
pub struct ModulePathMintypmaxExpressionTernary {
|
||||
pub nodes: (
|
||||
ModulePathExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ModulePathExpression<'a>,
|
||||
Symbol<'a>,
|
||||
ModulePathExpression<'a>,
|
||||
ModulePathExpression,
|
||||
Symbol,
|
||||
ModulePathExpression,
|
||||
Symbol,
|
||||
ModulePathExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PartSelectRange<'a> {
|
||||
ConstantRange(ConstantRange<'a>),
|
||||
IndexedRange(IndexedRange<'a>),
|
||||
pub enum PartSelectRange {
|
||||
ConstantRange(ConstantRange),
|
||||
IndexedRange(IndexedRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IndexedRange<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, ConstantExpression<'a>),
|
||||
pub struct IndexedRange {
|
||||
pub nodes: (Expression, Symbol, ConstantExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarExpression<'a> {
|
||||
pub nodes: (ConstantExpression<'a>,),
|
||||
pub struct GenvarExpression {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -11,153 +11,153 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Number<'a> {
|
||||
IntegralNumber(IntegralNumber<'a>),
|
||||
RealNumber(RealNumber<'a>),
|
||||
pub enum Number {
|
||||
IntegralNumber(IntegralNumber),
|
||||
RealNumber(RealNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum IntegralNumber<'a> {
|
||||
DecimalNumber(DecimalNumber<'a>),
|
||||
OctalNumber(OctalNumber<'a>),
|
||||
BinaryNumber(BinaryNumber<'a>),
|
||||
HexNumber(HexNumber<'a>),
|
||||
pub enum IntegralNumber {
|
||||
DecimalNumber(DecimalNumber),
|
||||
OctalNumber(OctalNumber),
|
||||
BinaryNumber(BinaryNumber),
|
||||
HexNumber(HexNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DecimalNumber<'a> {
|
||||
UnsignedNumber(UnsignedNumber<'a>),
|
||||
BaseUnsigned(DecimalNumberBaseUnsigned<'a>),
|
||||
BaseXNumber(DecimalNumberBaseXNumber<'a>),
|
||||
BaseZNumber(DecimalNumberBaseZNumber<'a>),
|
||||
pub enum DecimalNumber {
|
||||
UnsignedNumber(UnsignedNumber),
|
||||
BaseUnsigned(DecimalNumberBaseUnsigned),
|
||||
BaseXNumber(DecimalNumberBaseXNumber),
|
||||
BaseZNumber(DecimalNumberBaseZNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DecimalNumberBaseUnsigned<'a> {
|
||||
pub nodes: (Option<Size<'a>>, DecimalBase<'a>, UnsignedNumber<'a>),
|
||||
pub struct DecimalNumberBaseUnsigned {
|
||||
pub nodes: (Option<Size>, DecimalBase, UnsignedNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DecimalNumberBaseXNumber<'a> {
|
||||
pub nodes: (Option<Size<'a>>, DecimalBase<'a>, XNumber<'a>),
|
||||
pub struct DecimalNumberBaseXNumber {
|
||||
pub nodes: (Option<Size>, DecimalBase, XNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DecimalNumberBaseZNumber<'a> {
|
||||
pub nodes: (Option<Size<'a>>, DecimalBase<'a>, ZNumber<'a>),
|
||||
pub struct DecimalNumberBaseZNumber {
|
||||
pub nodes: (Option<Size>, DecimalBase, ZNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinaryNumber<'a> {
|
||||
pub nodes: (Option<Size<'a>>, BinaryBase<'a>, BinaryValue<'a>),
|
||||
pub struct BinaryNumber {
|
||||
pub nodes: (Option<Size>, BinaryBase, BinaryValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OctalNumber<'a> {
|
||||
pub nodes: (Option<Size<'a>>, OctalBase<'a>, OctalValue<'a>),
|
||||
pub struct OctalNumber {
|
||||
pub nodes: (Option<Size>, OctalBase, OctalValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HexNumber<'a> {
|
||||
pub nodes: (Option<Size<'a>>, HexBase<'a>, HexValue<'a>),
|
||||
pub struct HexNumber {
|
||||
pub nodes: (Option<Size>, HexBase, HexValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Sign<'a> {
|
||||
Plus(Symbol<'a>),
|
||||
Minus(Symbol<'a>),
|
||||
pub enum Sign {
|
||||
Plus(Symbol),
|
||||
Minus(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Size<'a> {
|
||||
pub nodes: (NonZeroUnsignedNumber<'a>,),
|
||||
pub struct Size {
|
||||
pub nodes: (NonZeroUnsignedNumber,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonZeroUnsignedNumber<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct NonZeroUnsignedNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RealNumber<'a> {
|
||||
FixedPointNumber(FixedPointNumber<'a>),
|
||||
Floating(RealNumberFloating<'a>),
|
||||
pub enum RealNumber {
|
||||
FixedPointNumber(FixedPointNumber),
|
||||
Floating(RealNumberFloating),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RealNumberFloating<'a> {
|
||||
pub struct RealNumberFloating {
|
||||
pub nodes: (
|
||||
UnsignedNumber<'a>,
|
||||
Option<(Symbol<'a>, UnsignedNumber<'a>)>,
|
||||
Exp<'a>,
|
||||
Option<Sign<'a>>,
|
||||
UnsignedNumber<'a>,
|
||||
UnsignedNumber,
|
||||
Option<(Symbol, UnsignedNumber)>,
|
||||
Exp,
|
||||
Option<Sign>,
|
||||
UnsignedNumber,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FixedPointNumber<'a> {
|
||||
pub nodes: (UnsignedNumber<'a>, Symbol<'a>, UnsignedNumber<'a>),
|
||||
pub struct FixedPointNumber {
|
||||
pub nodes: (UnsignedNumber, Symbol, UnsignedNumber),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Exp<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct Exp {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnsignedNumber<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct UnsignedNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinaryValue<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct BinaryValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OctalValue<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct OctalValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HexValue<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct HexValue {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DecimalBase<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct DecimalBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinaryBase<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct BinaryBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OctalBase<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct OctalBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HexBase<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct HexBase {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct XNumber<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct XNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ZNumber<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct ZNumber {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnbasedUnsizedLiteral<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct UnbasedUnsizedLiteral {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -268,11 +268,12 @@ pub fn non_zero_unsigned_number(s: Span) -> IResult<Span, NonZeroUnsignedNumber>
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn non_zero_unsigned_number_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn non_zero_unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a("123456789")(s)?;
|
||||
fold_many0(alt((tag("_"), digit1)), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -301,7 +302,9 @@ pub fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
|
||||
#[parser]
|
||||
pub fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
|
||||
let (s, a) = unsigned_number(s)?;
|
||||
let (s, b) = map(tag("."), |x| Symbol { nodes: (x, vec![]) })(s)?;;
|
||||
let (s, b) = map(tag("."), |x: Span| Symbol {
|
||||
nodes: (x.into(), vec![]),
|
||||
})(s)?;
|
||||
let (s, c) = unsigned_number(s)?;
|
||||
Ok((s, FixedPointNumber { nodes: (a, b, c) }))
|
||||
}
|
||||
@ -319,11 +322,12 @@ pub fn unsigned_number(s: Span) -> IResult<Span, UnsignedNumber> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn unsigned_number_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = digit1(s)?;
|
||||
fold_many0(alt((tag("_"), digit1)), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -333,11 +337,12 @@ pub fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn binary_value_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn binary_value_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a("01xXzZ?")(s)?;
|
||||
fold_many0(alt((tag("_"), is_a("01xXzZ?"))), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), is_a("01xXzZ?"))), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -347,11 +352,12 @@ pub fn octal_value(s: Span) -> IResult<Span, OctalValue> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn octal_value_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn octal_value_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a("01234567xXzZ?")(s)?;
|
||||
fold_many0(alt((tag("_"), is_a("01234567xXzZ?"))), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), is_a("01234567xXzZ?"))), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -361,13 +367,14 @@ pub fn hex_value(s: Span) -> IResult<Span, HexValue> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn hex_value_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn hex_value_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a("0123456789abcdefABCDEFxXzZ?")(s)?;
|
||||
fold_many0(
|
||||
let (s, a) = fold_many0(
|
||||
alt((tag("_"), is_a("0123456789abcdefABCDEFxXzZ?"))),
|
||||
a,
|
||||
|acc, item| concat(acc, item).unwrap(),
|
||||
)(s)
|
||||
)(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -377,8 +384,9 @@ pub fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn decimal_base_impl(s: Span) -> IResult<Span, Span> {
|
||||
alt((tag_no_case("'d"), tag_no_case("'sd")))(s)
|
||||
pub fn decimal_base_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = alt((tag_no_case("'d"), tag_no_case("'sd")))(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -388,8 +396,9 @@ pub fn binary_base(s: Span) -> IResult<Span, BinaryBase> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn binary_base_impl(s: Span) -> IResult<Span, Span> {
|
||||
alt((tag_no_case("'b"), tag_no_case("'sb")))(s)
|
||||
pub fn binary_base_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = alt((tag_no_case("'b"), tag_no_case("'sb")))(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -399,8 +408,9 @@ pub fn octal_base(s: Span) -> IResult<Span, OctalBase> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn octal_base_impl(s: Span) -> IResult<Span, Span> {
|
||||
alt((tag_no_case("'o"), tag_no_case("'so")))(s)
|
||||
pub fn octal_base_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = alt((tag_no_case("'o"), tag_no_case("'so")))(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -410,8 +420,9 @@ pub fn hex_base(s: Span) -> IResult<Span, HexBase> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn hex_base_impl(s: Span) -> IResult<Span, Span> {
|
||||
alt((tag_no_case("'h"), tag_no_case("'sh")))(s)
|
||||
pub fn hex_base_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = alt((tag_no_case("'h"), tag_no_case("'sh")))(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -421,11 +432,12 @@ pub fn x_number(s: Span) -> IResult<Span, XNumber> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn x_number_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn x_number_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = tag_no_case("x")(s)?;
|
||||
fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -435,11 +447,12 @@ pub fn z_number(s: Span) -> IResult<Span, ZNumber> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn z_number_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn z_number_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = alt((tag_no_case("z"), tag("?")))(s)?;
|
||||
fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| {
|
||||
let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| {
|
||||
concat(acc, item).unwrap()
|
||||
})(s)
|
||||
})(s)?;
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
|
@ -6,28 +6,28 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnaryOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct UnaryOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinaryOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct BinaryOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IncOrDecOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct IncOrDecOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UnaryModulePathOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct UnaryModulePathOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinaryModulePathOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct BinaryModulePathOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,255 +8,255 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstantPrimary<'a> {
|
||||
PrimaryLiteral(PrimaryLiteral<'a>),
|
||||
PsParameter(ConstantPrimaryPsParameter<'a>),
|
||||
Specparam(ConstantPrimarySpecparam<'a>),
|
||||
GenvarIdentifier(GenvarIdentifier<'a>),
|
||||
FormalPort(ConstantPrimaryFormalPort<'a>),
|
||||
Enum(ConstantPrimaryEnum<'a>),
|
||||
Concatenation(ConstantPrimaryConcatenation<'a>),
|
||||
MultipleConcatenation(ConstantPrimaryMultipleConcatenation<'a>),
|
||||
ConstantFunctionCall(ConstantFunctionCall<'a>),
|
||||
ConstantLetExpression(ConstantLetExpression<'a>),
|
||||
MintypmaxExpression(ConstantPrimaryMintypmaxExpression<'a>),
|
||||
ConstantCast(ConstantCast<'a>),
|
||||
ConstantAssignmentPatternExpression(ConstantAssignmentPatternExpression<'a>),
|
||||
TypeReference(TypeReference<'a>),
|
||||
Null(Keyword<'a>),
|
||||
pub enum ConstantPrimary {
|
||||
PrimaryLiteral(PrimaryLiteral),
|
||||
PsParameter(ConstantPrimaryPsParameter),
|
||||
Specparam(ConstantPrimarySpecparam),
|
||||
GenvarIdentifier(GenvarIdentifier),
|
||||
FormalPort(ConstantPrimaryFormalPort),
|
||||
Enum(ConstantPrimaryEnum),
|
||||
Concatenation(ConstantPrimaryConcatenation),
|
||||
MultipleConcatenation(ConstantPrimaryMultipleConcatenation),
|
||||
ConstantFunctionCall(ConstantFunctionCall),
|
||||
ConstantLetExpression(ConstantLetExpression),
|
||||
MintypmaxExpression(ConstantPrimaryMintypmaxExpression),
|
||||
ConstantCast(ConstantCast),
|
||||
ConstantAssignmentPatternExpression(ConstantAssignmentPatternExpression),
|
||||
TypeReference(TypeReference),
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryPsParameter<'a> {
|
||||
pub nodes: (PsParameterIdentifier<'a>, ConstantSelect<'a>),
|
||||
pub struct ConstantPrimaryPsParameter {
|
||||
pub nodes: (PsParameterIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimarySpecparam<'a> {
|
||||
pub struct ConstantPrimarySpecparam {
|
||||
pub nodes: (
|
||||
SpecparamIdentifier<'a>,
|
||||
Option<Bracket<'a, ConstantRangeExpression<'a>>>,
|
||||
SpecparamIdentifier,
|
||||
Option<Bracket< ConstantRangeExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryFormalPort<'a> {
|
||||
pub nodes: (FormalPortIdentifier<'a>, ConstantSelect<'a>),
|
||||
pub struct ConstantPrimaryFormalPort {
|
||||
pub nodes: (FormalPortIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryEnum<'a> {
|
||||
pub nodes: (PackageScopeOrClassScope<'a>, EnumIdentifier<'a>),
|
||||
pub struct ConstantPrimaryEnum {
|
||||
pub nodes: (PackageScopeOrClassScope, EnumIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryConcatenation<'a> {
|
||||
pub struct ConstantPrimaryConcatenation {
|
||||
pub nodes: (
|
||||
ConstantConcatenation<'a>,
|
||||
Option<Bracket<'a, ConstantRangeExpression<'a>>>,
|
||||
ConstantConcatenation,
|
||||
Option<Bracket< ConstantRangeExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryMultipleConcatenation<'a> {
|
||||
pub struct ConstantPrimaryMultipleConcatenation {
|
||||
pub nodes: (
|
||||
ConstantMultipleConcatenation<'a>,
|
||||
Option<Bracket<'a, ConstantRangeExpression<'a>>>,
|
||||
ConstantMultipleConcatenation,
|
||||
Option<Bracket< ConstantRangeExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantPrimaryMintypmaxExpression<'a> {
|
||||
pub nodes: (Paren<'a, ConstantMintypmaxExpression<'a>>,),
|
||||
pub struct ConstantPrimaryMintypmaxExpression {
|
||||
pub nodes: (Paren< ConstantMintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModulePathPrimary<'a> {
|
||||
Number(Number<'a>),
|
||||
Identifier(Identifier<'a>),
|
||||
ModulePathConcatenation(ModulePathConcatenation<'a>),
|
||||
ModulePathMultipleConcatenation(ModulePathMultipleConcatenation<'a>),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall<'a>),
|
||||
Mintypmax(ModulePathPrimaryMintypmax<'a>),
|
||||
pub enum ModulePathPrimary {
|
||||
Number(Number),
|
||||
Identifier(Identifier),
|
||||
ModulePathConcatenation(ModulePathConcatenation),
|
||||
ModulePathMultipleConcatenation(ModulePathMultipleConcatenation),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall),
|
||||
Mintypmax(ModulePathPrimaryMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModulePathPrimaryMintypmax<'a> {
|
||||
pub nodes: (Paren<'a, ModulePathMintypmaxExpression<'a>>,),
|
||||
pub struct ModulePathPrimaryMintypmax {
|
||||
pub nodes: (Paren< ModulePathMintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Primary<'a> {
|
||||
PrimaryLiteral(PrimaryLiteral<'a>),
|
||||
Hierarchical(PrimaryHierarchical<'a>),
|
||||
EmptyUnpackedArrayConcatenation(EmptyUnpackedArrayConcatenation<'a>),
|
||||
Concatenation(PrimaryConcatenation<'a>),
|
||||
MultipleConcatenation(PrimaryMultipleConcatenation<'a>),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall<'a>),
|
||||
LetExpression(LetExpression<'a>),
|
||||
MintypmaxExpression(PrimaryMintypmaxExpression<'a>),
|
||||
Cast(Cast<'a>),
|
||||
AssignmentPatternExpression(AssignmentPatternExpression<'a>),
|
||||
StreamingConcatenation(StreamingConcatenation<'a>),
|
||||
SequenceMethodCall(SequenceMethodCall<'a>),
|
||||
This(Keyword<'a>),
|
||||
Dollar(Symbol<'a>),
|
||||
Null(Keyword<'a>),
|
||||
pub enum Primary {
|
||||
PrimaryLiteral(PrimaryLiteral),
|
||||
Hierarchical(PrimaryHierarchical),
|
||||
EmptyUnpackedArrayConcatenation(EmptyUnpackedArrayConcatenation),
|
||||
Concatenation(PrimaryConcatenation),
|
||||
MultipleConcatenation(PrimaryMultipleConcatenation),
|
||||
FunctionSubroutineCall(FunctionSubroutineCall),
|
||||
LetExpression(LetExpression),
|
||||
MintypmaxExpression(PrimaryMintypmaxExpression),
|
||||
Cast(Cast),
|
||||
AssignmentPatternExpression(AssignmentPatternExpression),
|
||||
StreamingConcatenation(StreamingConcatenation),
|
||||
SequenceMethodCall(SequenceMethodCall),
|
||||
This(Keyword),
|
||||
Dollar(Symbol),
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PrimaryHierarchical<'a> {
|
||||
pub struct PrimaryHierarchical {
|
||||
pub nodes: (
|
||||
Option<ClassQualifierOrPackageScope<'a>>,
|
||||
HierarchicalIdentifier<'a>,
|
||||
Select<'a>,
|
||||
Option<ClassQualifierOrPackageScope>,
|
||||
HierarchicalIdentifier,
|
||||
Select,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PrimaryConcatenation<'a> {
|
||||
pub nodes: (Concatenation<'a>, Option<Bracket<'a, RangeExpression<'a>>>),
|
||||
pub struct PrimaryConcatenation {
|
||||
pub nodes: (Concatenation, Option<Bracket< RangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PrimaryMultipleConcatenation<'a> {
|
||||
pub struct PrimaryMultipleConcatenation {
|
||||
pub nodes: (
|
||||
MultipleConcatenation<'a>,
|
||||
Option<Bracket<'a, RangeExpression<'a>>>,
|
||||
MultipleConcatenation,
|
||||
Option<Bracket< RangeExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PrimaryMintypmaxExpression<'a> {
|
||||
pub nodes: (Paren<'a, MintypmaxExpression<'a>>,),
|
||||
pub struct PrimaryMintypmaxExpression {
|
||||
pub nodes: (Paren< MintypmaxExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassQualifierOrPackageScope<'a> {
|
||||
ClassQualifier(ClassQualifier<'a>),
|
||||
PackageScope(PackageScope<'a>),
|
||||
pub enum ClassQualifierOrPackageScope {
|
||||
ClassQualifier(ClassQualifier),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassQualifier<'a> {
|
||||
pub struct ClassQualifier {
|
||||
pub nodes: (
|
||||
Option<Local<'a>>,
|
||||
Option<ImplicitClassHandleOrClassScope<'a>>,
|
||||
Option<Local>,
|
||||
Option<ImplicitClassHandleOrClassScope>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RangeExpression<'a> {
|
||||
Expression(Expression<'a>),
|
||||
PartSelectRange(PartSelectRange<'a>),
|
||||
pub enum RangeExpression {
|
||||
Expression(Expression),
|
||||
PartSelectRange(PartSelectRange),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PrimaryLiteral<'a> {
|
||||
Number(Number<'a>),
|
||||
TimeLiteral(TimeLiteral<'a>),
|
||||
UnbasedUnsizedLiteral(UnbasedUnsizedLiteral<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
pub enum PrimaryLiteral {
|
||||
Number(Number),
|
||||
TimeLiteral(TimeLiteral),
|
||||
UnbasedUnsizedLiteral(UnbasedUnsizedLiteral),
|
||||
StringLiteral(StringLiteral),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TimeLiteral<'a> {
|
||||
Unsigned(TimeLiteralUnsigned<'a>),
|
||||
FixedPoint(TimeLiteralFixedPoint<'a>),
|
||||
pub enum TimeLiteral {
|
||||
Unsigned(TimeLiteralUnsigned),
|
||||
FixedPoint(TimeLiteralFixedPoint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeLiteralUnsigned<'a> {
|
||||
pub nodes: (UnsignedNumber<'a>, TimeUnit<'a>),
|
||||
pub struct TimeLiteralUnsigned {
|
||||
pub nodes: (UnsignedNumber, TimeUnit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeLiteralFixedPoint<'a> {
|
||||
pub nodes: (FixedPointNumber<'a>, TimeUnit<'a>),
|
||||
pub struct TimeLiteralFixedPoint {
|
||||
pub nodes: (FixedPointNumber, TimeUnit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TimeUnit<'a> {
|
||||
S(Keyword<'a>),
|
||||
MS(Keyword<'a>),
|
||||
US(Keyword<'a>),
|
||||
NS(Keyword<'a>),
|
||||
PS(Keyword<'a>),
|
||||
FS(Keyword<'a>),
|
||||
pub enum TimeUnit {
|
||||
S(Keyword),
|
||||
MS(Keyword),
|
||||
US(Keyword),
|
||||
NS(Keyword),
|
||||
PS(Keyword),
|
||||
FS(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImplicitClassHandle<'a> {
|
||||
This(Keyword<'a>),
|
||||
Super(Keyword<'a>),
|
||||
ThisSuper((Keyword<'a>, Symbol<'a>, Keyword<'a>)),
|
||||
pub enum ImplicitClassHandle {
|
||||
This(Keyword),
|
||||
Super(Keyword),
|
||||
ThisSuper((Keyword, Symbol, Keyword)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BitSelect<'a> {
|
||||
nodes: (Vec<Bracket<'a, Expression<'a>>>,),
|
||||
pub struct BitSelect {
|
||||
nodes: (Vec<Bracket< Expression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Select<'a> {
|
||||
pub struct Select {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
Vec<(Symbol<'a>, MemberIdentifier<'a>, BitSelect<'a>)>,
|
||||
Symbol<'a>,
|
||||
MemberIdentifier<'a>,
|
||||
Vec<(Symbol, MemberIdentifier, BitSelect)>,
|
||||
Symbol,
|
||||
MemberIdentifier,
|
||||
)>,
|
||||
BitSelect<'a>,
|
||||
Option<Bracket<'a, PartSelectRange<'a>>>,
|
||||
BitSelect,
|
||||
Option<Bracket< PartSelectRange>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonrangeSelect<'a> {
|
||||
pub struct NonrangeSelect {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
Vec<(Symbol<'a>, MemberIdentifier<'a>, BitSelect<'a>)>,
|
||||
Symbol<'a>,
|
||||
MemberIdentifier<'a>,
|
||||
Vec<(Symbol, MemberIdentifier, BitSelect)>,
|
||||
Symbol,
|
||||
MemberIdentifier,
|
||||
)>,
|
||||
BitSelect<'a>,
|
||||
BitSelect,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantBitSelect<'a> {
|
||||
nodes: (Vec<Bracket<'a, ConstantExpression<'a>>>,),
|
||||
pub struct ConstantBitSelect {
|
||||
nodes: (Vec<Bracket< ConstantExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantSelect<'a> {
|
||||
pub struct ConstantSelect {
|
||||
pub nodes: (
|
||||
Option<(
|
||||
Vec<(Symbol<'a>, MemberIdentifier<'a>, ConstantBitSelect<'a>)>,
|
||||
Symbol<'a>,
|
||||
MemberIdentifier<'a>,
|
||||
Vec<(Symbol, MemberIdentifier, ConstantBitSelect)>,
|
||||
Symbol,
|
||||
MemberIdentifier,
|
||||
)>,
|
||||
ConstantBitSelect<'a>,
|
||||
Option<Bracket<'a, ConstantPartSelectRange<'a>>>,
|
||||
ConstantBitSelect,
|
||||
Option<Bracket< ConstantPartSelectRange>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantCast<'a> {
|
||||
pub struct ConstantCast {
|
||||
pub nodes: (
|
||||
CastingType<'a>,
|
||||
Symbol<'a>,
|
||||
Paren<'a, ConstantExpression<'a>>,
|
||||
CastingType,
|
||||
Symbol,
|
||||
Paren< ConstantExpression>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantLetExpression<'a> {
|
||||
pub nodes: (LetExpression<'a>,),
|
||||
pub struct ConstantLetExpression {
|
||||
pub nodes: (LetExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Cast<'a> {
|
||||
pub nodes: (CastingType<'a>, Symbol<'a>, Paren<'a, Expression<'a>>),
|
||||
pub struct Cast {
|
||||
pub nodes: (CastingType, Symbol, Paren< Expression>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,8 +9,8 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StringLiteral<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct StringLiteral {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -22,7 +22,7 @@ pub fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn string_literal_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn string_literal_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = tag("\"")(s)?;
|
||||
let (s, b) = many1(pair(is_not("\\\""), opt(pair(tag("\\"), take(1usize)))))(s)?;
|
||||
let (s, c) = tag("\"")(s)?;
|
||||
@ -52,7 +52,7 @@ pub fn string_literal_impl(s: Span) -> IResult<Span, Span> {
|
||||
let a = concat(a, b).unwrap();
|
||||
let a = concat(a, c).unwrap();
|
||||
|
||||
Ok((s, a))
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,177 +9,177 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstantFunctionCall<'a> {
|
||||
pub nodes: (FunctionSubroutineCall<'a>,),
|
||||
pub struct ConstantFunctionCall {
|
||||
pub nodes: (FunctionSubroutineCall,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TfCall<'a> {
|
||||
pub struct TfCall {
|
||||
pub nodes: (
|
||||
PsOrHierarchicalTfIdentifier<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
PsOrHierarchicalTfIdentifier,
|
||||
Vec<AttributeInstance>,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SystemTfCall<'a> {
|
||||
ArgOptionl(SystemTfCallArgOptional<'a>),
|
||||
ArgDataType(SystemTfCallArgDataType<'a>),
|
||||
ArgExpression(SystemTfCallArgExpression<'a>),
|
||||
pub enum SystemTfCall {
|
||||
ArgOptionl(SystemTfCallArgOptional),
|
||||
ArgDataType(SystemTfCallArgDataType),
|
||||
ArgExpression(SystemTfCallArgExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SystemTfCallArgOptional<'a> {
|
||||
pub struct SystemTfCallArgOptional {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier<'a>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
SystemTfIdentifier,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SystemTfCallArgDataType<'a> {
|
||||
pub struct SystemTfCallArgDataType {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier<'a>,
|
||||
Paren<'a, (DataType<'a>, Option<(Symbol<'a>, Expression<'a>)>)>,
|
||||
SystemTfIdentifier,
|
||||
Paren< (DataType, Option<(Symbol, Expression)>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SystemTfCallArgExpression<'a> {
|
||||
pub struct SystemTfCallArgExpression {
|
||||
pub nodes: (
|
||||
SystemTfIdentifier<'a>,
|
||||
SystemTfIdentifier,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
List<Symbol<'a>, Option<Expression<'a>>>,
|
||||
Option<(Symbol<'a>, Option<ClockingEvent<'a>>)>,
|
||||
List<Symbol, Option<Expression>>,
|
||||
Option<(Symbol, Option<ClockingEvent>)>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SubroutineCall<'a> {
|
||||
TfCall(Box<TfCall<'a>>),
|
||||
SystemTfCall(Box<SystemTfCall<'a>>),
|
||||
MethodCall(Box<MethodCall<'a>>),
|
||||
Randomize(Box<SubroutineCallRandomize<'a>>),
|
||||
pub enum SubroutineCall {
|
||||
TfCall(Box<TfCall>),
|
||||
SystemTfCall(Box<SystemTfCall>),
|
||||
MethodCall(Box<MethodCall>),
|
||||
Randomize(Box<SubroutineCallRandomize>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SubroutineCallRandomize<'a> {
|
||||
pub nodes: (Option<(Keyword<'a>, Symbol<'a>)>, RandomizeCall<'a>),
|
||||
pub struct SubroutineCallRandomize {
|
||||
pub nodes: (Option<(Keyword, Symbol)>, RandomizeCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionSubroutineCall<'a> {
|
||||
pub nodes: (SubroutineCall<'a>,),
|
||||
pub struct FunctionSubroutineCall {
|
||||
pub nodes: (SubroutineCall,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ListOfArguments<'a> {
|
||||
Ordered(ListOfArgumentsOrdered<'a>),
|
||||
Named(ListOfArgumentsNamed<'a>),
|
||||
pub enum ListOfArguments {
|
||||
Ordered(ListOfArgumentsOrdered),
|
||||
Named(ListOfArgumentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfArgumentsOrdered<'a> {
|
||||
pub struct ListOfArgumentsOrdered {
|
||||
pub nodes: (
|
||||
List<Symbol<'a>, Option<Expression<'a>>>,
|
||||
List<Symbol, Option<Expression>>,
|
||||
Vec<(
|
||||
Symbol<'a>,
|
||||
Symbol<'a>,
|
||||
Identifier<'a>,
|
||||
Paren<'a, Option<Expression<'a>>>,
|
||||
Symbol,
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren< Option<Expression>>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfArgumentsNamed<'a> {
|
||||
pub struct ListOfArgumentsNamed {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Identifier<'a>,
|
||||
Paren<'a, Option<Expression<'a>>>,
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren< Option<Expression>>,
|
||||
Vec<(
|
||||
Symbol<'a>,
|
||||
Symbol<'a>,
|
||||
Identifier<'a>,
|
||||
Paren<'a, Option<Expression<'a>>>,
|
||||
Symbol,
|
||||
Symbol,
|
||||
Identifier,
|
||||
Paren< Option<Expression>>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MethodCall<'a> {
|
||||
pub nodes: (MethodCallRoot<'a>, Symbol<'a>, MethodCallBody<'a>),
|
||||
pub struct MethodCall {
|
||||
pub nodes: (MethodCallRoot, Symbol, MethodCallBody),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum MethodCallBody<'a> {
|
||||
User(MethodCallBodyUser<'a>),
|
||||
BuiltInMethodCall(BuiltInMethodCall<'a>),
|
||||
pub enum MethodCallBody {
|
||||
User(MethodCallBodyUser),
|
||||
BuiltInMethodCall(BuiltInMethodCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MethodCallBodyUser<'a> {
|
||||
pub struct MethodCallBodyUser {
|
||||
pub nodes: (
|
||||
MethodIdentifier<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
MethodIdentifier,
|
||||
Vec<AttributeInstance>,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BuiltInMethodCall<'a> {
|
||||
ArrayManipulationCall(ArrayManipulationCall<'a>),
|
||||
RandomizeCall(RandomizeCall<'a>),
|
||||
pub enum BuiltInMethodCall {
|
||||
ArrayManipulationCall(ArrayManipulationCall),
|
||||
RandomizeCall(RandomizeCall),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ArrayManipulationCall<'a> {
|
||||
pub struct ArrayManipulationCall {
|
||||
pub nodes: (
|
||||
ArrayMethodName<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>,
|
||||
ArrayMethodName,
|
||||
Vec<AttributeInstance>,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
Option<(Keyword, Paren< Expression>)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RandomizeCall<'a> {
|
||||
pub struct RandomizeCall {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<Paren<'a, Option<VariableIdentifierListOrNull<'a>>>>,
|
||||
Keyword,
|
||||
Vec<AttributeInstance>,
|
||||
Option<Paren< Option<VariableIdentifierListOrNull>>>,
|
||||
Option<(
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<IdentifierList<'a>>>>,
|
||||
ConstraintBlock<'a>,
|
||||
Keyword,
|
||||
Option<Paren< Option<IdentifierList>>>,
|
||||
ConstraintBlock,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum VariableIdentifierListOrNull<'a> {
|
||||
VariableIdentifierList(VariableIdentifierList<'a>),
|
||||
Null(Keyword<'a>),
|
||||
pub enum VariableIdentifierListOrNull {
|
||||
VariableIdentifierList(VariableIdentifierList),
|
||||
Null(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum MethodCallRoot<'a> {
|
||||
Primary(Primary<'a>),
|
||||
ImplicitClassHandle(ImplicitClassHandle<'a>),
|
||||
pub enum MethodCallRoot {
|
||||
Primary(Primary),
|
||||
ImplicitClassHandle(ImplicitClassHandle),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ArrayMethodName<'a> {
|
||||
MethodIdentifier(MethodIdentifier<'a>),
|
||||
Unique(Keyword<'a>),
|
||||
And(Keyword<'a>),
|
||||
Or(Keyword<'a>),
|
||||
Xor(Keyword<'a>),
|
||||
pub enum ArrayMethodName {
|
||||
MethodIdentifier(MethodIdentifier),
|
||||
Unique(Keyword),
|
||||
And(Keyword),
|
||||
Or(Keyword),
|
||||
Xor(Keyword),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,13 +7,13 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AttributeInstance<'a> {
|
||||
pub nodes: (Symbol<'a>, List<Symbol<'a>, AttrSpec<'a>>, Symbol<'a>),
|
||||
pub struct AttributeInstance {
|
||||
pub nodes: (Symbol, List<Symbol, AttrSpec>, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AttrSpec<'a> {
|
||||
pub nodes: (Identifier<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>),
|
||||
pub struct AttrSpec {
|
||||
pub nodes: (Identifier, Option<(Symbol, ConstantExpression)>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,8 +7,8 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Comment<'a> {
|
||||
nodes: (Span<'a>,),
|
||||
pub struct Comment {
|
||||
nodes: (Locate,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -23,7 +23,7 @@ pub fn one_line_comment(s: Span) -> IResult<Span, Comment> {
|
||||
let (s, a) = tag("//")(s)?;
|
||||
let (s, b) = is_not("\n")(s)?;
|
||||
let a = concat(a, b).unwrap();
|
||||
Ok((s, Comment { nodes: (a,) }))
|
||||
Ok((s, Comment { nodes: (a.into(),) }))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -33,7 +33,7 @@ pub fn block_comment(s: Span) -> IResult<Span, Comment> {
|
||||
let (s, c) = tag("*/")(s)?;
|
||||
let a = concat(a, b).unwrap();
|
||||
let a = concat(a, c).unwrap();
|
||||
Ok((s, Comment { nodes: (a,) }))
|
||||
Ok((s, Comment { nodes: (a.into(),) }))
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -15,532 +15,526 @@ pub const AZ09_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012
|
||||
pub const AZ09_DOLLAR: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ArrayIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ArrayIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BlockIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct BlockIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BinIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct BinIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CIdentifier<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct CIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CellIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct CellIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct CheckerIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ClassIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassVariableIdentifier<'a> {
|
||||
pub nodes: (VariableIdentifier<'a>,),
|
||||
pub struct ClassVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClockingIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ClockingIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ConfigIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ConstIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ConstraintIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct CovergroupIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CovergroupVariableIdentifier<'a> {
|
||||
pub nodes: (VariableIdentifier<'a>,),
|
||||
pub struct CovergroupVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CoverPointIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct CoverPointIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CrossIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct CrossIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DynamicArrayVariableIdentifier<'a> {
|
||||
pub nodes: (VariableIdentifier<'a>,),
|
||||
pub struct DynamicArrayVariableIdentifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnumIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct EnumIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EscapedIdentifier<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct EscapedIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FormalIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct FormalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FormalPortIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct FormalPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FunctionIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct FunctionIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenerateBlockIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct GenerateBlockIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct GenvarIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalArrayIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalArrayIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalBlockIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalBlockIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalEventIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalEventIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalIdentifier<'a> {
|
||||
pub struct HierarchicalIdentifier {
|
||||
pub nodes: (
|
||||
Option<Root<'a>>,
|
||||
Vec<(Identifier<'a>, ConstantBitSelect<'a>, Symbol<'a>)>,
|
||||
Identifier<'a>,
|
||||
Option<Root>,
|
||||
Vec<(Identifier, ConstantBitSelect, Symbol)>,
|
||||
Identifier,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Root<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>),
|
||||
pub struct Root {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalNetIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalNetIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalParameterIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalParameterIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalPropertyIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalPropertyIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalSequenceIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalSequenceIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalTaskIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalTaskIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalTfIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalTfIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalVariableIdentifier<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>,),
|
||||
pub struct HierarchicalVariableIdentifier {
|
||||
pub nodes: (HierarchicalIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Identifier<'a> {
|
||||
SimpleIdentifier(SimpleIdentifier<'a>),
|
||||
EscapedIdentifier(EscapedIdentifier<'a>),
|
||||
pub enum Identifier {
|
||||
SimpleIdentifier(SimpleIdentifier),
|
||||
EscapedIdentifier(EscapedIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IndexVariableIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct IndexVariableIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct InterfaceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceInstanceIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct InterfaceInstanceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InoutPortIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct InoutPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InputPortIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct InputPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InstanceIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct InstanceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LibraryIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct LibraryIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MemberIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct MemberIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MethodIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct MethodIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModportIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ModportIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ModuleIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct NetIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetTypeIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct NetTypeIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputPortIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct OutputPortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct PackageIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageScope<'a> {
|
||||
Package(PackageScopePackage<'a>),
|
||||
Unit(Unit<'a>),
|
||||
pub enum PackageScope {
|
||||
Package(PackageScopePackage),
|
||||
Unit(Unit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageScopePackage<'a> {
|
||||
pub nodes: (PackageIdentifier<'a>, Symbol<'a>),
|
||||
pub struct PackageScopePackage {
|
||||
pub nodes: (PackageIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Unit<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>),
|
||||
pub struct Unit {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ParameterIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct PortIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProductionIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ProductionIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct ProgramIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PropertyIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct PropertyIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsClassIdentifier<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, ClassIdentifier<'a>),
|
||||
pub struct PsClassIdentifier {
|
||||
pub nodes: (Option<PackageScope>, ClassIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsCovergroupIdentifier<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, CovergroupIdentifier<'a>),
|
||||
pub struct PsCovergroupIdentifier {
|
||||
pub nodes: (Option<PackageScope>, CovergroupIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsCheckerIdentifier<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, CheckerIdentifier<'a>),
|
||||
pub struct PsCheckerIdentifier {
|
||||
pub nodes: (Option<PackageScope>, CheckerIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsIdentifier<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, Identifier<'a>),
|
||||
pub struct PsIdentifier {
|
||||
pub nodes: (Option<PackageScope>, Identifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalArrayIdentifier<'a> {
|
||||
pub struct PsOrHierarchicalArrayIdentifier {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope<'a>>,
|
||||
HierarchicalArrayIdentifier<'a>,
|
||||
Option<ImplicitClassHandleOrClassScopeOrPackageScope>,
|
||||
HierarchicalArrayIdentifier,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PsOrHierarchicalNetIdentifier<'a> {
|
||||
PackageScope(PsOrHierarchicalNetIdentifierPackageScope<'a>),
|
||||
HierarchicalNetIdentifier(HierarchicalNetIdentifier<'a>),
|
||||
pub enum PsOrHierarchicalNetIdentifier {
|
||||
PackageScope(PsOrHierarchicalNetIdentifierPackageScope),
|
||||
HierarchicalNetIdentifier(HierarchicalNetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalNetIdentifierPackageScope<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, NetIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalNetIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, NetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalNetIdentifierHierarchical<'a> {
|
||||
pub nodes: (HierarchicalNetIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalNetIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalNetIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PsOrHierarchicalPropertyIdentifier<'a> {
|
||||
PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope<'a>),
|
||||
HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier<'a>),
|
||||
pub enum PsOrHierarchicalPropertyIdentifier {
|
||||
PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope),
|
||||
HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalPropertyIdentifierPackageScope<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, PropertyIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalPropertyIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, PropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalPropertyIdentifierHierarchical<'a> {
|
||||
pub nodes: (HierarchicalPropertyIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalPropertyIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalPropertyIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PsOrHierarchicalSequenceIdentifier<'a> {
|
||||
PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope<'a>),
|
||||
HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier<'a>),
|
||||
pub enum PsOrHierarchicalSequenceIdentifier {
|
||||
PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope),
|
||||
HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalSequenceIdentifierPackageScope<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, SequenceIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalSequenceIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, SequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalSequenceIdentifierHierarchical<'a> {
|
||||
pub nodes: (HierarchicalSequenceIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalSequenceIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalSequenceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PsOrHierarchicalTfIdentifier<'a> {
|
||||
PackageScope(PsOrHierarchicalTfIdentifierPackageScope<'a>),
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier<'a>),
|
||||
pub enum PsOrHierarchicalTfIdentifier {
|
||||
PackageScope(PsOrHierarchicalTfIdentifierPackageScope),
|
||||
HierarchicalTfIdentifier(HierarchicalTfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalTfIdentifierPackageScope<'a> {
|
||||
pub nodes: (Option<PackageScope<'a>>, TfIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalTfIdentifierPackageScope {
|
||||
pub nodes: (Option<PackageScope>, TfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsOrHierarchicalTfIdentifierHierarchical<'a> {
|
||||
pub nodes: (HierarchicalTfIdentifier<'a>),
|
||||
pub struct PsOrHierarchicalTfIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalTfIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PsParameterIdentifier<'a> {
|
||||
Scope(PsParameterIdentifierScope<'a>),
|
||||
Generate(PsParameterIdentifierGenerate<'a>),
|
||||
pub enum PsParameterIdentifier {
|
||||
Scope(PsParameterIdentifierScope),
|
||||
Generate(PsParameterIdentifierGenerate),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsParameterIdentifierScope<'a> {
|
||||
pub nodes: (
|
||||
Option<PackageScopeOrClassScope<'a>>,
|
||||
ParameterIdentifier<'a>,
|
||||
),
|
||||
pub struct PsParameterIdentifierScope {
|
||||
pub nodes: (Option<PackageScopeOrClassScope>, ParameterIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsParameterIdentifierGenerate<'a> {
|
||||
pub struct PsParameterIdentifierGenerate {
|
||||
pub nodes: (
|
||||
Vec<(
|
||||
GenerateBlockIdentifier<'a>,
|
||||
Option<Bracket<'a, ConstantExpression<'a>>>,
|
||||
Symbol<'a>,
|
||||
GenerateBlockIdentifier,
|
||||
Option<Bracket<ConstantExpression>>,
|
||||
Symbol,
|
||||
)>,
|
||||
ParameterIdentifier<'a>,
|
||||
ParameterIdentifier,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PsTypeIdentifier<'a> {
|
||||
pub nodes: (
|
||||
Option<LocalOrPackageScopeOrClassScope<'a>>,
|
||||
TypeIdentifier<'a>,
|
||||
),
|
||||
pub struct PsTypeIdentifier {
|
||||
pub nodes: (Option<LocalOrPackageScopeOrClassScope>, TypeIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LocalOrPackageScopeOrClassScope<'a> {
|
||||
Local(Local<'a>),
|
||||
PackageScope(PackageScope<'a>),
|
||||
ClassScope(ClassScope<'a>),
|
||||
pub enum LocalOrPackageScopeOrClassScope {
|
||||
Local(Local),
|
||||
PackageScope(PackageScope),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Local<'a> {
|
||||
pub nodes: (Keyword<'a>, Symbol<'a>),
|
||||
pub struct Local {
|
||||
pub nodes: (Keyword, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SequenceIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct SequenceIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SignalIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct SignalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimpleIdentifier<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct SimpleIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecparamIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct SpecparamIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SystemTfIdentifier<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct SystemTfIdentifier {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TaskIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct TaskIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TfIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct TfIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TerminalIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct TerminalIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TopmoduleIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct TopmoduleIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TypeIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct TypeIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct UdpIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariableIdentifier<'a> {
|
||||
pub nodes: (Identifier<'a>,),
|
||||
pub struct VariableIdentifier {
|
||||
pub nodes: (Identifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrClassScopeOrPackageScope<'a> {
|
||||
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
|
||||
ClassScope(ClassScope<'a>),
|
||||
PackageScope(PackageScope<'a>),
|
||||
pub enum ImplicitClassHandleOrClassScopeOrPackageScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrPackageScope<'a> {
|
||||
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
|
||||
PackageScope(PackageScope<'a>),
|
||||
pub enum ImplicitClassHandleOrPackageScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
PackageScope(PackageScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ImplicitClassHandleOrClassScope<'a> {
|
||||
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
|
||||
ClassScope(ClassScope<'a>),
|
||||
pub enum ImplicitClassHandleOrClassScope {
|
||||
ImplicitClassHandle((ImplicitClassHandle, Symbol)),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageScopeOrClassScope<'a> {
|
||||
PackageScope(PackageScope<'a>),
|
||||
ClassScope(ClassScope<'a>),
|
||||
pub enum PackageScopeOrClassScope {
|
||||
PackageScope(PackageScope),
|
||||
ClassScope(ClassScope),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -570,7 +564,7 @@ pub fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn c_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn c_identifier_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a(AZ_)(s)?;
|
||||
let (s, b) = opt(is_a(AZ09_))(s)?;
|
||||
let a = if let Some(b) = b {
|
||||
@ -581,7 +575,7 @@ pub fn c_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
if is_keyword(&a) {
|
||||
Err(Err::Error(make_error(s, ErrorKind::Fix)))
|
||||
} else {
|
||||
Ok((s, a))
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -676,11 +670,11 @@ pub fn escaped_identifier(s: Span) -> IResult<Span, EscapedIdentifier> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn escaped_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn escaped_identifier_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = tag("\\")(s)?;
|
||||
let (s, b) = is_not(" \t\r\n")(s)?;
|
||||
let a = concat(a, b).unwrap();
|
||||
Ok((s, a))
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
@ -1135,7 +1129,7 @@ pub fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn simple_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn simple_identifier_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = is_a(AZ_)(s)?;
|
||||
let (s, b) = opt(is_a(AZ09_DOLLAR))(s)?;
|
||||
let a = if let Some(b) = b {
|
||||
@ -1146,7 +1140,7 @@ pub fn simple_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
if is_keyword(&a) {
|
||||
Err(Err::Error(make_error(s, ErrorKind::Fix)))
|
||||
} else {
|
||||
Ok((s, a))
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1163,11 +1157,11 @@ pub fn system_tf_identifier(s: Span) -> IResult<Span, SystemTfIdentifier> {
|
||||
}
|
||||
|
||||
#[parser]
|
||||
pub fn system_tf_identifier_impl(s: Span) -> IResult<Span, Span> {
|
||||
pub fn system_tf_identifier_impl(s: Span) -> IResult<Span, Locate> {
|
||||
let (s, a) = tag("$")(s)?;
|
||||
let (s, b) = is_a(AZ09_DOLLAR)(s)?;
|
||||
let a = concat(a, b).unwrap();
|
||||
Ok((s, a))
|
||||
Ok((s, a.into()))
|
||||
}
|
||||
|
||||
#[parser]
|
||||
|
@ -8,55 +8,55 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerInstantiation<'a> {
|
||||
pub struct CheckerInstantiation {
|
||||
pub nodes: (
|
||||
PsCheckerIdentifier<'a>,
|
||||
NameOfInstance<'a>,
|
||||
Paren<'a, Option<ListOfCheckerPortConnections<'a>>>,
|
||||
Symbol<'a>,
|
||||
PsCheckerIdentifier,
|
||||
NameOfInstance,
|
||||
Paren< Option<ListOfCheckerPortConnections>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ListOfCheckerPortConnections<'a> {
|
||||
Ordered(ListOfCheckerPortConnectionsOrdered<'a>),
|
||||
Named(ListOfCheckerPortConnectionsNamed<'a>),
|
||||
pub enum ListOfCheckerPortConnections {
|
||||
Ordered(ListOfCheckerPortConnectionsOrdered),
|
||||
Named(ListOfCheckerPortConnectionsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfCheckerPortConnectionsOrdered<'a> {
|
||||
pub nodes: (List<Symbol<'a>, OrderedCheckerPortConnection<'a>>,),
|
||||
pub struct ListOfCheckerPortConnectionsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedCheckerPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfCheckerPortConnectionsNamed<'a> {
|
||||
pub nodes: (List<Symbol<'a>, NamedCheckerPortConnection<'a>>,),
|
||||
pub struct ListOfCheckerPortConnectionsNamed {
|
||||
pub nodes: (List<Symbol, NamedCheckerPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OrderedCheckerPortConnection<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Option<PropertyActualArg<'a>>),
|
||||
pub struct OrderedCheckerPortConnection {
|
||||
pub nodes: (Vec<AttributeInstance>, Option<PropertyActualArg>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NamedCheckerPortConnection<'a> {
|
||||
Identifier(NamedCheckerPortConnectionIdentifier<'a>),
|
||||
Asterisk(NamedCheckerPortConnectionAsterisk<'a>),
|
||||
pub enum NamedCheckerPortConnection {
|
||||
Identifier(NamedCheckerPortConnectionIdentifier),
|
||||
Asterisk(NamedCheckerPortConnectionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NamedCheckerPortConnectionIdentifier<'a> {
|
||||
pub struct NamedCheckerPortConnectionIdentifier {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
FormalPortIdentifier<'a>,
|
||||
Option<Paren<'a, Option<PropertyActualArg<'a>>>>,
|
||||
Vec<AttributeInstance>,
|
||||
Symbol,
|
||||
FormalPortIdentifier,
|
||||
Option<Paren< Option<PropertyActualArg>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NamedCheckerPortConnectionAsterisk<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
|
||||
pub struct NamedCheckerPortConnectionAsterisk {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,138 +9,138 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenerateRegion<'a> {
|
||||
pub nodes: (Keyword<'a>, Vec<GenerateItem<'a>>, Keyword<'a>),
|
||||
pub struct GenerateRegion {
|
||||
pub nodes: (Keyword, Vec<GenerateItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LoopGenerateConstruct<'a> {
|
||||
pub struct LoopGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
GenvarInitialization<'a>,
|
||||
Symbol<'a>,
|
||||
GenvarExpression<'a>,
|
||||
Symbol<'a>,
|
||||
GenvarIteration<'a>,
|
||||
GenvarInitialization,
|
||||
Symbol,
|
||||
GenvarExpression,
|
||||
Symbol,
|
||||
GenvarIteration,
|
||||
),
|
||||
>,
|
||||
GenerateBlock<'a>,
|
||||
GenerateBlock,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarInitialization<'a> {
|
||||
pub struct GenvarInitialization {
|
||||
pub nodes: (
|
||||
Option<Genvar<'a>>,
|
||||
GenvarIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
ConstantExpression<'a>,
|
||||
Option<Genvar>,
|
||||
GenvarIdentifier,
|
||||
Symbol,
|
||||
ConstantExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Genvar<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Genvar {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum GenvarIteration<'a> {
|
||||
Assignment(GenvarIterationAssignment<'a>),
|
||||
Prefix(GenvarIterationPrefix<'a>),
|
||||
Suffix(GenvarIterationSuffix<'a>),
|
||||
pub enum GenvarIteration {
|
||||
Assignment(GenvarIterationAssignment),
|
||||
Prefix(GenvarIterationPrefix),
|
||||
Suffix(GenvarIterationSuffix),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarIterationAssignment<'a> {
|
||||
pub struct GenvarIterationAssignment {
|
||||
pub nodes: (
|
||||
GenvarIdentifier<'a>,
|
||||
AssignmentOperator<'a>,
|
||||
GenvarExpression<'a>,
|
||||
GenvarIdentifier,
|
||||
AssignmentOperator,
|
||||
GenvarExpression,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarIterationPrefix<'a> {
|
||||
pub nodes: (IncOrDecOperator<'a>, GenvarIdentifier<'a>),
|
||||
pub struct GenvarIterationPrefix {
|
||||
pub nodes: (IncOrDecOperator, GenvarIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenvarIterationSuffix<'a> {
|
||||
pub nodes: (GenvarIdentifier<'a>, IncOrDecOperator<'a>),
|
||||
pub struct GenvarIterationSuffix {
|
||||
pub nodes: (GenvarIdentifier, IncOrDecOperator),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConditionalGenerateConstruct<'a> {
|
||||
If(IfGenerateConstruct<'a>),
|
||||
Case(CaseGenerateConstruct<'a>),
|
||||
pub enum ConditionalGenerateConstruct {
|
||||
If(IfGenerateConstruct),
|
||||
Case(CaseGenerateConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IfGenerateConstruct<'a> {
|
||||
pub struct IfGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, ConstantExpression<'a>>,
|
||||
GenerateBlock<'a>,
|
||||
Option<(Keyword<'a>, GenerateBlock<'a>)>,
|
||||
Keyword,
|
||||
Paren< ConstantExpression>,
|
||||
GenerateBlock,
|
||||
Option<(Keyword, GenerateBlock)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseGenerateConstruct<'a> {
|
||||
pub struct CaseGenerateConstruct {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, ConstantExpression<'a>>,
|
||||
Vec<CaseGenerateItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Paren< ConstantExpression>,
|
||||
Vec<CaseGenerateItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CaseGenerateItem<'a> {
|
||||
Nondefault(CaseGenerateItemNondefault<'a>),
|
||||
Default(CaseGenerateItemDefault<'a>),
|
||||
pub enum CaseGenerateItem {
|
||||
Nondefault(CaseGenerateItemNondefault),
|
||||
Default(CaseGenerateItemDefault),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseGenerateItemNondefault<'a> {
|
||||
pub struct CaseGenerateItemNondefault {
|
||||
pub nodes: (
|
||||
List<Symbol<'a>, ConstantExpression<'a>>,
|
||||
Symbol<'a>,
|
||||
GenerateBlock<'a>,
|
||||
List<Symbol, ConstantExpression>,
|
||||
Symbol,
|
||||
GenerateBlock,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CaseGenerateItemDefault<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<Symbol<'a>>, GenerateBlock<'a>),
|
||||
pub struct CaseGenerateItemDefault {
|
||||
pub nodes: (Keyword, Option<Symbol>, GenerateBlock),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum GenerateBlock<'a> {
|
||||
GenerateItem(GenerateItem<'a>),
|
||||
Multiple(GenerateBlockMultiple<'a>),
|
||||
pub enum GenerateBlock {
|
||||
GenerateItem(GenerateItem),
|
||||
Multiple(GenerateBlockMultiple),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GenerateBlockMultiple<'a> {
|
||||
pub struct GenerateBlockMultiple {
|
||||
pub nodes: (
|
||||
Option<(GenerateBlockIdentifier<'a>, Symbol<'a>)>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>,
|
||||
Vec<GenerateItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>,
|
||||
Option<(GenerateBlockIdentifier, Symbol)>,
|
||||
Keyword,
|
||||
Option<(Symbol, GenerateBlockIdentifier)>,
|
||||
Vec<GenerateItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, GenerateBlockIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum GenerateItem<'a> {
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem<'a>),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>),
|
||||
CheckerOrGenerateItem(CheckerOrGenerateItem<'a>),
|
||||
pub enum GenerateItem {
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem),
|
||||
CheckerOrGenerateItem(CheckerOrGenerateItem),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -6,12 +6,12 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceInstantiation<'a> {
|
||||
pub struct InterfaceInstantiation {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
List<Symbol<'a>, HierarchicalInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
InterfaceIdentifier,
|
||||
Option<ParameterValueAssignment>,
|
||||
List<Symbol, HierarchicalInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -8,106 +8,106 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleInstantiation<'a> {
|
||||
pub struct ModuleInstantiation {
|
||||
pub nodes: (
|
||||
ModuleIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
List<Symbol<'a>, HierarchicalInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
ModuleIdentifier,
|
||||
Option<ParameterValueAssignment>,
|
||||
List<Symbol, HierarchicalInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterValueAssignment<'a> {
|
||||
pub struct ParameterValueAssignment {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Paren<'a, Option<ListOfParameterAssignments<'a>>>,
|
||||
Symbol,
|
||||
Paren< Option<ListOfParameterAssignments>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ListOfParameterAssignments<'a> {
|
||||
Ordered(ListOfParameterAssignmentsOrdered<'a>),
|
||||
Named(ListOfParameterAssignmentsNamed<'a>),
|
||||
pub enum ListOfParameterAssignments {
|
||||
Ordered(ListOfParameterAssignmentsOrdered),
|
||||
Named(ListOfParameterAssignmentsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfParameterAssignmentsOrdered<'a> {
|
||||
pub nodes: (List<Symbol<'a>, OrderedParameterAssignment<'a>>,),
|
||||
pub struct ListOfParameterAssignmentsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedParameterAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfParameterAssignmentsNamed<'a> {
|
||||
pub nodes: (List<Symbol<'a>, NamedParameterAssignment<'a>>,),
|
||||
pub struct ListOfParameterAssignmentsNamed {
|
||||
pub nodes: (List<Symbol, NamedParameterAssignment>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OrderedParameterAssignment<'a> {
|
||||
pub nodes: (ParamExpression<'a>,),
|
||||
pub struct OrderedParameterAssignment {
|
||||
pub nodes: (ParamExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NamedParameterAssignment<'a> {
|
||||
pub struct NamedParameterAssignment {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
ParameterIdentifier<'a>,
|
||||
Paren<'a, Option<ParamExpression<'a>>>,
|
||||
Symbol,
|
||||
ParameterIdentifier,
|
||||
Paren< Option<ParamExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HierarchicalInstance<'a> {
|
||||
pub struct HierarchicalInstance {
|
||||
pub nodes: (
|
||||
NameOfInstance<'a>,
|
||||
Paren<'a, Option<ListOfPortConnections<'a>>>,
|
||||
NameOfInstance,
|
||||
Paren< Option<ListOfPortConnections>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NameOfInstance<'a> {
|
||||
pub nodes: (InstanceIdentifier<'a>, Vec<UnpackedDimension<'a>>),
|
||||
pub struct NameOfInstance {
|
||||
pub nodes: (InstanceIdentifier, Vec<UnpackedDimension>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ListOfPortConnections<'a> {
|
||||
Ordered(ListOfPortConnectionsOrdered<'a>),
|
||||
Named(ListOfPortConnectionsNamed<'a>),
|
||||
pub enum ListOfPortConnections {
|
||||
Ordered(ListOfPortConnectionsOrdered),
|
||||
Named(ListOfPortConnectionsNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPortConnectionsOrdered<'a> {
|
||||
pub nodes: (List<Symbol<'a>, OrderedPortConnection<'a>>,),
|
||||
pub struct ListOfPortConnectionsOrdered {
|
||||
pub nodes: (List<Symbol, OrderedPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPortConnectionsNamed<'a> {
|
||||
pub nodes: (List<Symbol<'a>, NamedPortConnection<'a>>,),
|
||||
pub struct ListOfPortConnectionsNamed {
|
||||
pub nodes: (List<Symbol, NamedPortConnection>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OrderedPortConnection<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Option<Expression<'a>>),
|
||||
pub struct OrderedPortConnection {
|
||||
pub nodes: (Vec<AttributeInstance>, Option<Expression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NamedPortConnection<'a> {
|
||||
Identifier(NamedPortConnectionIdentifier<'a>),
|
||||
Asterisk(NamedPortConnectionAsterisk<'a>),
|
||||
pub enum NamedPortConnection {
|
||||
Identifier(NamedPortConnectionIdentifier),
|
||||
Asterisk(NamedPortConnectionAsterisk),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NamedPortConnectionIdentifier<'a> {
|
||||
pub struct NamedPortConnectionIdentifier {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
PortIdentifier<'a>,
|
||||
Option<Paren<'a, Option<Expression<'a>>>>,
|
||||
Vec<AttributeInstance>,
|
||||
Symbol,
|
||||
PortIdentifier,
|
||||
Option<Paren< Option<Expression>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NamedPortConnectionAsterisk<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
|
||||
pub struct NamedPortConnectionAsterisk {
|
||||
pub nodes: (Vec<AttributeInstance>, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -6,12 +6,12 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramInstantiation<'a> {
|
||||
pub struct ProgramInstantiation {
|
||||
pub nodes: (
|
||||
ProgramIdentifier<'a>,
|
||||
Option<ParameterValueAssignment<'a>>,
|
||||
List<Symbol<'a>, HierarchicalInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
ProgramIdentifier,
|
||||
Option<ParameterValueAssignment>,
|
||||
List<Symbol, HierarchicalInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -6,38 +6,38 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CmosSwitchtype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct CmosSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnableGatetype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct EnableGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MosSwitchtype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct MosSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NInputGatetype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct NInputGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NOutputGatetype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct NOutputGatetype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PassEnSwitchtype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct PassEnSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PassSwitchtype<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct PassSwitchtype {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,221 +8,221 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum GateInstantiation<'a> {
|
||||
Cmos(GateInstantiationCmos<'a>),
|
||||
Enable(GateInstantiationEnable<'a>),
|
||||
Mos(GateInstantiationMos<'a>),
|
||||
NInput(GateInstantiationNInput<'a>),
|
||||
NOutput(GateInstantiationNOutput<'a>),
|
||||
PassEn(GateInstantiationPassEn<'a>),
|
||||
Pass(GateInstantiationPass<'a>),
|
||||
Pulldown(GateInstantiationPulldown<'a>),
|
||||
Pullup(GateInstantiationPullup<'a>),
|
||||
pub enum GateInstantiation {
|
||||
Cmos(GateInstantiationCmos),
|
||||
Enable(GateInstantiationEnable),
|
||||
Mos(GateInstantiationMos),
|
||||
NInput(GateInstantiationNInput),
|
||||
NOutput(GateInstantiationNOutput),
|
||||
PassEn(GateInstantiationPassEn),
|
||||
Pass(GateInstantiationPass),
|
||||
Pulldown(GateInstantiationPulldown),
|
||||
Pullup(GateInstantiationPullup),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationCmos<'a> {
|
||||
pub struct GateInstantiationCmos {
|
||||
pub nodes: (
|
||||
CmosSwitchtype<'a>,
|
||||
Option<Delay3<'a>>,
|
||||
List<Symbol<'a>, CmosSwitchInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
CmosSwitchtype,
|
||||
Option<Delay3>,
|
||||
List<Symbol, CmosSwitchInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationEnable<'a> {
|
||||
pub struct GateInstantiationEnable {
|
||||
pub nodes: (
|
||||
EnableGatetype<'a>,
|
||||
Option<DriveStrength<'a>>,
|
||||
Option<Delay3<'a>>,
|
||||
List<Symbol<'a>, EnableGateInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
EnableGatetype,
|
||||
Option<DriveStrength>,
|
||||
Option<Delay3>,
|
||||
List<Symbol, EnableGateInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationMos<'a> {
|
||||
pub struct GateInstantiationMos {
|
||||
pub nodes: (
|
||||
MosSwitchtype<'a>,
|
||||
Option<Delay3<'a>>,
|
||||
List<Symbol<'a>, MosSwitchInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
MosSwitchtype,
|
||||
Option<Delay3>,
|
||||
List<Symbol, MosSwitchInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationNInput<'a> {
|
||||
pub struct GateInstantiationNInput {
|
||||
pub nodes: (
|
||||
NInputGatetype<'a>,
|
||||
Option<DriveStrength<'a>>,
|
||||
Option<Delay2<'a>>,
|
||||
List<Symbol<'a>, NInputGateInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
NInputGatetype,
|
||||
Option<DriveStrength>,
|
||||
Option<Delay2>,
|
||||
List<Symbol, NInputGateInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationNOutput<'a> {
|
||||
pub struct GateInstantiationNOutput {
|
||||
pub nodes: (
|
||||
NOutputGatetype<'a>,
|
||||
Option<DriveStrength<'a>>,
|
||||
Option<Delay2<'a>>,
|
||||
List<Symbol<'a>, NOutputGateInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
NOutputGatetype,
|
||||
Option<DriveStrength>,
|
||||
Option<Delay2>,
|
||||
List<Symbol, NOutputGateInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationPassEn<'a> {
|
||||
pub struct GateInstantiationPassEn {
|
||||
pub nodes: (
|
||||
PassEnSwitchtype<'a>,
|
||||
Option<Delay2<'a>>,
|
||||
List<Symbol<'a>, PassEnableSwitchInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
PassEnSwitchtype,
|
||||
Option<Delay2>,
|
||||
List<Symbol, PassEnableSwitchInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationPass<'a> {
|
||||
pub struct GateInstantiationPass {
|
||||
pub nodes: (
|
||||
PassSwitchtype<'a>,
|
||||
List<Symbol<'a>, PassSwitchInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
PassSwitchtype,
|
||||
List<Symbol, PassSwitchInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationPulldown<'a> {
|
||||
pub struct GateInstantiationPulldown {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<PulldownStrength<'a>>,
|
||||
List<Symbol<'a>, PullGateInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<PulldownStrength>,
|
||||
List<Symbol, PullGateInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct GateInstantiationPullup<'a> {
|
||||
pub struct GateInstantiationPullup {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<PullupStrength<'a>>,
|
||||
List<Symbol<'a>, PullGateInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<PullupStrength>,
|
||||
List<Symbol, PullGateInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CmosSwitchInstance<'a> {
|
||||
pub struct CmosSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
OutputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
InputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
NcontrolTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
PcontrolTerminal<'a>,
|
||||
OutputTerminal,
|
||||
Symbol,
|
||||
InputTerminal,
|
||||
Symbol,
|
||||
NcontrolTerminal,
|
||||
Symbol,
|
||||
PcontrolTerminal,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnableGateInstance<'a> {
|
||||
pub struct EnableGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
OutputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
InputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
EnableTerminal<'a>,
|
||||
OutputTerminal,
|
||||
Symbol,
|
||||
InputTerminal,
|
||||
Symbol,
|
||||
EnableTerminal,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct MosSwitchInstance<'a> {
|
||||
pub struct MosSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
OutputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
InputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
EnableTerminal<'a>,
|
||||
OutputTerminal,
|
||||
Symbol,
|
||||
InputTerminal,
|
||||
Symbol,
|
||||
EnableTerminal,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NInputGateInstance<'a> {
|
||||
pub struct NInputGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
OutputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
List<Symbol<'a>, InputTerminal<'a>>,
|
||||
OutputTerminal,
|
||||
Symbol,
|
||||
List<Symbol, InputTerminal>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NOutputGateInstance<'a> {
|
||||
pub struct NOutputGateInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
List<Symbol<'a>, OutputTerminal<'a>>,
|
||||
Symbol<'a>,
|
||||
InputTerminal<'a>,
|
||||
List<Symbol, OutputTerminal>,
|
||||
Symbol,
|
||||
InputTerminal,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PassSwitchInstance<'a> {
|
||||
pub struct PassSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Paren<'a, (InoutTerminal<'a>, Symbol<'a>, InoutTerminal<'a>)>,
|
||||
Option<NameOfInstance>,
|
||||
Paren< (InoutTerminal, Symbol, InoutTerminal)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PassEnableSwitchInstance<'a> {
|
||||
pub struct PassEnableSwitchInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
InoutTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
InoutTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
EnableTerminal<'a>,
|
||||
InoutTerminal,
|
||||
Symbol,
|
||||
InoutTerminal,
|
||||
Symbol,
|
||||
EnableTerminal,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PullGateInstance<'a> {
|
||||
pub nodes: (Option<NameOfInstance<'a>>, Paren<'a, OutputTerminal<'a>>),
|
||||
pub struct PullGateInstance {
|
||||
pub nodes: (Option<NameOfInstance>, Paren< OutputTerminal>),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -6,47 +6,47 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PulldownStrength<'a> {
|
||||
Strength01(PulldownStrength01<'a>),
|
||||
Strength10(PulldownStrength10<'a>),
|
||||
Strength0(PulldownStrength0<'a>),
|
||||
pub enum PulldownStrength {
|
||||
Strength01(PulldownStrength01),
|
||||
Strength10(PulldownStrength10),
|
||||
Strength0(PulldownStrength0),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulldownStrength01<'a> {
|
||||
pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,),
|
||||
pub struct PulldownStrength01 {
|
||||
pub nodes: (Paren< (Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulldownStrength10<'a> {
|
||||
pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,),
|
||||
pub struct PulldownStrength10 {
|
||||
pub nodes: (Paren< (Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulldownStrength0<'a> {
|
||||
pub nodes: (Paren<'a, Strength0<'a>>,),
|
||||
pub struct PulldownStrength0 {
|
||||
pub nodes: (Paren< Strength0>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PullupStrength<'a> {
|
||||
Strength01(PullupStrength01<'a>),
|
||||
Strength10(PullupStrength10<'a>),
|
||||
Strength1(PullupStrength1<'a>),
|
||||
pub enum PullupStrength {
|
||||
Strength01(PullupStrength01),
|
||||
Strength10(PullupStrength10),
|
||||
Strength1(PullupStrength1),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PullupStrength01<'a> {
|
||||
pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,),
|
||||
pub struct PullupStrength01 {
|
||||
pub nodes: (Paren< (Strength0, Symbol, Strength1)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PullupStrength10<'a> {
|
||||
pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,),
|
||||
pub struct PullupStrength10 {
|
||||
pub nodes: (Paren< (Strength1, Symbol, Strength0)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PullupStrength1<'a> {
|
||||
pub nodes: (Paren<'a, Strength1<'a>>,),
|
||||
pub struct PullupStrength1 {
|
||||
pub nodes: (Paren< Strength1>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -5,33 +5,33 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EnableTerminal<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct EnableTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InoutTerminal<'a> {
|
||||
pub nodes: (NetLvalue<'a>,),
|
||||
pub struct InoutTerminal {
|
||||
pub nodes: (NetLvalue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InputTerminal<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct InputTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NcontrolTerminal<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct NcontrolTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputTerminal<'a> {
|
||||
pub nodes: (NetLvalue<'a>,),
|
||||
pub struct OutputTerminal {
|
||||
pub nodes: (NetLvalue,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PcontrolTerminal<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct PcontrolTerminal {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,85 +9,85 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerPortList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, CheckerPortItem<'a>>,),
|
||||
pub struct CheckerPortList {
|
||||
pub nodes: (List<Symbol, CheckerPortItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerPortItem<'a> {
|
||||
pub struct CheckerPortItem {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Option<CheckerPortDirection<'a>>,
|
||||
PropertyFormalType<'a>,
|
||||
FormalPortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, PropertyActualArg<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Option<CheckerPortDirection>,
|
||||
PropertyFormalType,
|
||||
FormalPortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, PropertyActualArg)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CheckerPortDirection<'a> {
|
||||
Input(Keyword<'a>),
|
||||
Output(Keyword<'a>),
|
||||
pub enum CheckerPortDirection {
|
||||
Input(Keyword),
|
||||
Output(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CheckerOrGenerateItem<'a> {
|
||||
CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration<'a>),
|
||||
InitialConstruct(InitialConstruct<'a>),
|
||||
AlwaysConstruct(AlwaysConstruct<'a>),
|
||||
FinalConstruct(FinalConstruct<'a>),
|
||||
AssertionItem(AssertionItem<'a>),
|
||||
ContinuousAssign(ContinuousAssign<'a>),
|
||||
CheckerGenerateItem(CheckerGenerateItem<'a>),
|
||||
pub enum CheckerOrGenerateItem {
|
||||
CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration),
|
||||
InitialConstruct(InitialConstruct),
|
||||
AlwaysConstruct(AlwaysConstruct),
|
||||
FinalConstruct(FinalConstruct),
|
||||
AssertionItem(AssertionItem),
|
||||
ContinuousAssign(ContinuousAssign),
|
||||
CheckerGenerateItem(CheckerGenerateItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CheckerOrGenerateItemDeclaration<'a> {
|
||||
Data(CheckerOrGenerateItemDeclarationData<'a>),
|
||||
FunctionDeclaration(FunctionDeclaration<'a>),
|
||||
CheckerDeclaration(CheckerDeclaration<'a>),
|
||||
AssertionItemDeclaration(AssertionItemDeclaration<'a>),
|
||||
CovergroupDeclaration(CovergroupDeclaration<'a>),
|
||||
GenvarDeclaration(GenvarDeclaration<'a>),
|
||||
ClockingDeclaration(ClockingDeclaration<'a>),
|
||||
Clocking(CheckerOrGenerateItemDeclarationClocking<'a>),
|
||||
Disable(CheckerOrGenerateItemDeclarationDisable<'a>),
|
||||
Empty(Symbol<'a>),
|
||||
pub enum CheckerOrGenerateItemDeclaration {
|
||||
Data(CheckerOrGenerateItemDeclarationData),
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
CheckerDeclaration(CheckerDeclaration),
|
||||
AssertionItemDeclaration(AssertionItemDeclaration),
|
||||
CovergroupDeclaration(CovergroupDeclaration),
|
||||
GenvarDeclaration(GenvarDeclaration),
|
||||
ClockingDeclaration(ClockingDeclaration),
|
||||
Clocking(CheckerOrGenerateItemDeclarationClocking),
|
||||
Disable(CheckerOrGenerateItemDeclarationDisable),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationData<'a> {
|
||||
pub nodes: (Option<Rand<'a>>, DataDeclaration<'a>),
|
||||
pub struct CheckerOrGenerateItemDeclarationData {
|
||||
pub nodes: (Option<Rand>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Rand<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Rand {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationClocking<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>),
|
||||
pub struct CheckerOrGenerateItemDeclarationClocking {
|
||||
pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerOrGenerateItemDeclarationDisable<'a> {
|
||||
pub struct CheckerOrGenerateItemDeclarationDisable {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
ExpressionOrDist<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Keyword,
|
||||
ExpressionOrDist,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum CheckerGenerateItem<'a> {
|
||||
LoopGenerateConstruct(Box<LoopGenerateConstruct<'a>>),
|
||||
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct<'a>>),
|
||||
GenerateRegion(GenerateRegion<'a>),
|
||||
ElaborationSystemTask(ElaborationSystemTask<'a>),
|
||||
pub enum CheckerGenerateItem {
|
||||
LoopGenerateConstruct(Box<LoopGenerateConstruct>),
|
||||
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct>),
|
||||
GenerateRegion(GenerateRegion),
|
||||
ElaborationSystemTask(ElaborationSystemTask),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,193 +9,193 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassItem<'a> {
|
||||
Property(ClassItemProperty<'a>),
|
||||
Method(ClassItemMethod<'a>),
|
||||
Constraint(ClassItemConstraint<'a>),
|
||||
Declaration(ClassItemDeclaration<'a>),
|
||||
Covergroup(ClassItemCovergroup<'a>),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)),
|
||||
ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)),
|
||||
Empty(Symbol<'a>),
|
||||
pub enum ClassItem {
|
||||
Property(ClassItemProperty),
|
||||
Method(ClassItemMethod),
|
||||
Constraint(ClassItemConstraint),
|
||||
Declaration(ClassItemDeclaration),
|
||||
Covergroup(ClassItemCovergroup),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration, Symbol)),
|
||||
ParameterDeclaration((ParameterDeclaration, Symbol)),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassItemProperty<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ClassProperty<'a>),
|
||||
pub struct ClassItemProperty {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassProperty),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassItemMethod<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ClassMethod<'a>),
|
||||
pub struct ClassItemMethod {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassItemConstraint<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ClassConstraint<'a>),
|
||||
pub struct ClassItemConstraint {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassConstraint),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassItemDeclaration<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ClassDeclaration<'a>),
|
||||
pub struct ClassItemDeclaration {
|
||||
pub nodes: (Vec<AttributeInstance>, ClassDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassItemCovergroup<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, CovergroupDeclaration<'a>),
|
||||
pub struct ClassItemCovergroup {
|
||||
pub nodes: (Vec<AttributeInstance>, CovergroupDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassProperty<'a> {
|
||||
NonConst(ClassPropertyNonConst<'a>),
|
||||
Const(ClassPropertyConst<'a>),
|
||||
pub enum ClassProperty {
|
||||
NonConst(ClassPropertyNonConst),
|
||||
Const(ClassPropertyConst),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassPropertyNonConst<'a> {
|
||||
pub nodes: (Vec<PropertyQualifier<'a>>, DataDeclaration<'a>),
|
||||
pub struct ClassPropertyNonConst {
|
||||
pub nodes: (Vec<PropertyQualifier>, DataDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassPropertyConst<'a> {
|
||||
pub struct ClassPropertyConst {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Vec<ClassItemQualifier<'a>>,
|
||||
DataType<'a>,
|
||||
ConstIdentifier<'a>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Vec<ClassItemQualifier>,
|
||||
DataType,
|
||||
ConstIdentifier,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassMethod<'a> {
|
||||
Task(ClassMethodTask<'a>),
|
||||
Function(ClassMethodFunction<'a>),
|
||||
PureVirtual(ClassMethodPureVirtual<'a>),
|
||||
ExternMethod(ClassMethodExternMethod<'a>),
|
||||
Constructor(ClassMethodConstructor<'a>),
|
||||
ExternConstructor(ClassMethodExternConstructor<'a>),
|
||||
pub enum ClassMethod {
|
||||
Task(ClassMethodTask),
|
||||
Function(ClassMethodFunction),
|
||||
PureVirtual(ClassMethodPureVirtual),
|
||||
ExternMethod(ClassMethodExternMethod),
|
||||
Constructor(ClassMethodConstructor),
|
||||
ExternConstructor(ClassMethodExternConstructor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodTask<'a> {
|
||||
pub nodes: (Vec<MethodQualifier<'a>>, TaskDeclaration<'a>),
|
||||
pub struct ClassMethodTask {
|
||||
pub nodes: (Vec<MethodQualifier>, TaskDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodFunction<'a> {
|
||||
pub nodes: (Vec<MethodQualifier<'a>>, FunctionDeclaration<'a>),
|
||||
pub struct ClassMethodFunction {
|
||||
pub nodes: (Vec<MethodQualifier>, FunctionDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodPureVirtual<'a> {
|
||||
pub struct ClassMethodPureVirtual {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Vec<ClassItemQualifier<'a>>,
|
||||
MethodPrototype<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Vec<ClassItemQualifier>,
|
||||
MethodPrototype,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodExternMethod<'a> {
|
||||
pub struct ClassMethodExternMethod {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Vec<MethodQualifier<'a>>,
|
||||
MethodPrototype<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Vec<MethodQualifier>,
|
||||
MethodPrototype,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodConstructor<'a> {
|
||||
pub nodes: (Vec<MethodQualifier<'a>>, ClassConstructorDeclaration<'a>),
|
||||
pub struct ClassMethodConstructor {
|
||||
pub nodes: (Vec<MethodQualifier>, ClassConstructorDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassMethodExternConstructor<'a> {
|
||||
pub struct ClassMethodExternConstructor {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Vec<MethodQualifier<'a>>,
|
||||
ClassConstructorPrototype<'a>,
|
||||
Keyword,
|
||||
Vec<MethodQualifier>,
|
||||
ClassConstructorPrototype,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassConstructorPrototype<'a> {
|
||||
pub struct ClassConstructorPrototype {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<TfPortList<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Option<Paren< Option<TfPortList>>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassConstraint<'a> {
|
||||
ConstraintPrototype(ConstraintPrototype<'a>),
|
||||
ConstraintDeclaration(ConstraintDeclaration<'a>),
|
||||
pub enum ClassConstraint {
|
||||
ConstraintPrototype(ConstraintPrototype),
|
||||
ConstraintDeclaration(ConstraintDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ClassItemQualifier<'a> {
|
||||
Static(Keyword<'a>),
|
||||
Protected(Keyword<'a>),
|
||||
Local(Keyword<'a>),
|
||||
pub enum ClassItemQualifier {
|
||||
Static(Keyword),
|
||||
Protected(Keyword),
|
||||
Local(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PropertyQualifier<'a> {
|
||||
RandomQualifier(RandomQualifier<'a>),
|
||||
ClassItemQualifier(ClassItemQualifier<'a>),
|
||||
pub enum PropertyQualifier {
|
||||
RandomQualifier(RandomQualifier),
|
||||
ClassItemQualifier(ClassItemQualifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum RandomQualifier<'a> {
|
||||
Rand(Keyword<'a>),
|
||||
Randc(Keyword<'a>),
|
||||
pub enum RandomQualifier {
|
||||
Rand(Keyword),
|
||||
Randc(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum MethodQualifier<'a> {
|
||||
Virtual(Keyword<'a>),
|
||||
PureVirtual((Keyword<'a>, Keyword<'a>)),
|
||||
ClassItemQualifier(ClassItemQualifier<'a>),
|
||||
pub enum MethodQualifier {
|
||||
Virtual(Keyword),
|
||||
PureVirtual((Keyword, Keyword)),
|
||||
ClassItemQualifier(ClassItemQualifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum MethodPrototype<'a> {
|
||||
TaskPrototype(TaskPrototype<'a>),
|
||||
FunctionPrototype(FunctionPrototype<'a>),
|
||||
pub enum MethodPrototype {
|
||||
TaskPrototype(TaskPrototype),
|
||||
FunctionPrototype(FunctionPrototype),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassConstructorDeclaration<'a> {
|
||||
pub struct ClassConstructorDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<ClassScope<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<TfPortList<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Vec<BlockItemDeclaration<'a>>,
|
||||
Keyword,
|
||||
Option<ClassScope>,
|
||||
Keyword,
|
||||
Option<Paren< Option<TfPortList>>>,
|
||||
Symbol,
|
||||
Vec<BlockItemDeclaration>,
|
||||
Option<(
|
||||
Keyword<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Symbol,
|
||||
Keyword,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
Symbol,
|
||||
)>,
|
||||
Vec<FunctionStatementOrNull<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, New<'a>)>,
|
||||
Vec<FunctionStatementOrNull>,
|
||||
Keyword,
|
||||
Option<(Symbol, New)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct New<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct New {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,137 +9,137 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigDeclaration<'a> {
|
||||
pub struct ConfigDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
ConfigIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<(LocalParameterDeclaration<'a>, Symbol<'a>)>,
|
||||
DesignStatement<'a>,
|
||||
Vec<ConfigRuleStatement<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ConfigIdentifier<'a>)>,
|
||||
Keyword,
|
||||
ConfigIdentifier,
|
||||
Symbol,
|
||||
Vec<(LocalParameterDeclaration, Symbol)>,
|
||||
DesignStatement,
|
||||
Vec<ConfigRuleStatement>,
|
||||
Keyword,
|
||||
Option<(Symbol, ConfigIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DesignStatement<'a> {
|
||||
pub struct DesignStatement {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Vec<(
|
||||
Option<(LibraryIdentifier<'a>, Symbol<'a>)>,
|
||||
CellIdentifier<'a>,
|
||||
Option<(LibraryIdentifier, Symbol)>,
|
||||
CellIdentifier,
|
||||
)>,
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConfigRuleStatement<'a> {
|
||||
Default(ConfigRuleStatementDefault<'a>),
|
||||
InstLib(ConfigRuleStatementInstLib<'a>),
|
||||
InstUse(ConfigRuleStatementInstUse<'a>),
|
||||
CellLib(ConfigRuleStatementCellLib<'a>),
|
||||
CellUse(ConfigRuleStatementCellUse<'a>),
|
||||
pub enum ConfigRuleStatement {
|
||||
Default(ConfigRuleStatementDefault),
|
||||
InstLib(ConfigRuleStatementInstLib),
|
||||
InstUse(ConfigRuleStatementInstUse),
|
||||
CellLib(ConfigRuleStatementCellLib),
|
||||
CellUse(ConfigRuleStatementCellUse),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigRuleStatementDefault<'a> {
|
||||
pub nodes: (DefaultClause<'a>, LiblistClause<'a>, Symbol<'a>),
|
||||
pub struct ConfigRuleStatementDefault {
|
||||
pub nodes: (DefaultClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigRuleStatementInstLib<'a> {
|
||||
pub nodes: (InstClause<'a>, LiblistClause<'a>, Symbol<'a>),
|
||||
pub struct ConfigRuleStatementInstLib {
|
||||
pub nodes: (InstClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigRuleStatementInstUse<'a> {
|
||||
pub nodes: (InstClause<'a>, UseClause<'a>, Symbol<'a>),
|
||||
pub struct ConfigRuleStatementInstUse {
|
||||
pub nodes: (InstClause, UseClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigRuleStatementCellLib<'a> {
|
||||
pub nodes: (CellClause<'a>, LiblistClause<'a>, Symbol<'a>),
|
||||
pub struct ConfigRuleStatementCellLib {
|
||||
pub nodes: (CellClause, LiblistClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConfigRuleStatementCellUse<'a> {
|
||||
pub nodes: (CellClause<'a>, UseClause<'a>, Symbol<'a>),
|
||||
pub struct ConfigRuleStatementCellUse {
|
||||
pub nodes: (CellClause, UseClause, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DefaultClause<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct DefaultClause {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InstClause<'a> {
|
||||
pub nodes: (Keyword<'a>, InstName<'a>),
|
||||
pub struct InstClause {
|
||||
pub nodes: (Keyword, InstName),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InstName<'a> {
|
||||
pub struct InstName {
|
||||
pub nodes: (
|
||||
TopmoduleIdentifier<'a>,
|
||||
Vec<(Symbol<'a>, InstanceIdentifier<'a>)>,
|
||||
TopmoduleIdentifier,
|
||||
Vec<(Symbol, InstanceIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CellClause<'a> {
|
||||
pub struct CellClause {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<(LibraryIdentifier<'a>, Symbol<'a>)>,
|
||||
CellIdentifier<'a>,
|
||||
Keyword,
|
||||
Option<(LibraryIdentifier, Symbol)>,
|
||||
CellIdentifier,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LiblistClause<'a> {
|
||||
pub nodes: (Keyword<'a>, Vec<LibraryIdentifier<'a>>),
|
||||
pub struct LiblistClause {
|
||||
pub nodes: (Keyword, Vec<LibraryIdentifier>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UseClause<'a> {
|
||||
Cell(UseClauseCell<'a>),
|
||||
Named(UseClauseNamed<'a>),
|
||||
CellNamed(UseClauseCellNamed<'a>),
|
||||
pub enum UseClause {
|
||||
Cell(UseClauseCell),
|
||||
Named(UseClauseNamed),
|
||||
CellNamed(UseClauseCellNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UseClauseCell<'a> {
|
||||
pub struct UseClauseCell {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<(LibraryIdentifier<'a>, Symbol<'a>)>,
|
||||
CellIdentifier<'a>,
|
||||
Option<(Symbol<'a>, Config<'a>)>,
|
||||
Keyword,
|
||||
Option<(LibraryIdentifier, Symbol)>,
|
||||
CellIdentifier,
|
||||
Option<(Symbol, Config)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UseClauseNamed<'a> {
|
||||
pub struct UseClauseNamed {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
List<Symbol<'a>, NamedParameterAssignment<'a>>,
|
||||
Option<(Symbol<'a>, Config<'a>)>,
|
||||
Keyword,
|
||||
List<Symbol, NamedParameterAssignment>,
|
||||
Option<(Symbol, Config)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UseClauseCellNamed<'a> {
|
||||
pub struct UseClauseCellNamed {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<(LibraryIdentifier<'a>, Symbol<'a>)>,
|
||||
CellIdentifier<'a>,
|
||||
List<Symbol<'a>, NamedParameterAssignment<'a>>,
|
||||
Option<(Symbol<'a>, Config<'a>)>,
|
||||
Keyword,
|
||||
Option<(LibraryIdentifier, Symbol)>,
|
||||
CellIdentifier,
|
||||
List<Symbol, NamedParameterAssignment>,
|
||||
Option<(Symbol, Config)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Config<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Config {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,184 +9,184 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintDeclaration<'a> {
|
||||
pub struct ConstraintDeclaration {
|
||||
pub nodes: (
|
||||
Option<Static<'a>>,
|
||||
Keyword<'a>,
|
||||
ConstraintIdentifier<'a>,
|
||||
ConstraintBlock<'a>,
|
||||
Option<Static>,
|
||||
Keyword,
|
||||
ConstraintIdentifier,
|
||||
ConstraintBlock,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Static<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Static {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintBlock<'a> {
|
||||
pub nodes: (Brace<'a, Vec<ConstraintBlockItem<'a>>>,),
|
||||
pub struct ConstraintBlock {
|
||||
pub nodes: (Brace< Vec<ConstraintBlockItem>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstraintBlockItem<'a> {
|
||||
Solve(ConstraintBlockItemSolve<'a>),
|
||||
ConstraintExpression(ConstraintExpression<'a>),
|
||||
pub enum ConstraintBlockItem {
|
||||
Solve(ConstraintBlockItemSolve),
|
||||
ConstraintExpression(ConstraintExpression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintBlockItemSolve<'a> {
|
||||
pub struct ConstraintBlockItemSolve {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
SolveBeforeList<'a>,
|
||||
Keyword<'a>,
|
||||
SolveBeforeList<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
SolveBeforeList,
|
||||
Keyword,
|
||||
SolveBeforeList,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SolveBeforeList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, ConstraintPrimary<'a>>,),
|
||||
pub struct SolveBeforeList {
|
||||
pub nodes: (List<Symbol, ConstraintPrimary>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintPrimary<'a> {
|
||||
pub struct ConstraintPrimary {
|
||||
pub nodes: (
|
||||
Option<ImplicitClassHandleOrClassScope<'a>>,
|
||||
HierarchicalIdentifier<'a>,
|
||||
Select<'a>,
|
||||
Option<ImplicitClassHandleOrClassScope>,
|
||||
HierarchicalIdentifier,
|
||||
Select,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstraintExpression<'a> {
|
||||
Expression(ConstraintExpressionExpression<'a>),
|
||||
UniquenessConstraint((UniquenessConstraint<'a>, Symbol<'a>)),
|
||||
Arrow(ConstraintExpressionArrow<'a>),
|
||||
If(ConstraintExpressionIf<'a>),
|
||||
Foreach(ConstraintExpressionForeach<'a>),
|
||||
Disable(ConstraintExpressionDisable<'a>),
|
||||
pub enum ConstraintExpression {
|
||||
Expression(ConstraintExpressionExpression),
|
||||
UniquenessConstraint((UniquenessConstraint, Symbol)),
|
||||
Arrow(ConstraintExpressionArrow),
|
||||
If(ConstraintExpressionIf),
|
||||
Foreach(ConstraintExpressionForeach),
|
||||
Disable(ConstraintExpressionDisable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintExpressionExpression<'a> {
|
||||
pub nodes: (Option<Soft<'a>>, ExpressionOrDist<'a>, Symbol<'a>),
|
||||
pub struct ConstraintExpressionExpression {
|
||||
pub nodes: (Option<Soft>, ExpressionOrDist, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Soft<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Soft {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintExpressionArrow<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, ConstraintSet<'a>),
|
||||
pub struct ConstraintExpressionArrow {
|
||||
pub nodes: (Expression, Symbol, ConstraintSet),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintExpressionIf<'a> {
|
||||
pub struct ConstraintExpressionIf {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, Expression<'a>>,
|
||||
ConstraintSet<'a>,
|
||||
Option<(Keyword<'a>, ConstraintSet<'a>)>,
|
||||
Keyword,
|
||||
Paren< Expression>,
|
||||
ConstraintSet,
|
||||
Option<(Keyword, ConstraintSet)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintExpressionForeach<'a> {
|
||||
pub struct ConstraintExpressionForeach {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
PsOrHierarchicalArrayIdentifier<'a>,
|
||||
Bracket<'a, LoopVariables<'a>>,
|
||||
PsOrHierarchicalArrayIdentifier,
|
||||
Bracket< LoopVariables>,
|
||||
),
|
||||
>,
|
||||
ConstraintSet<'a>,
|
||||
ConstraintSet,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintExpressionDisable<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, ConstraintPrimary<'a>, Symbol<'a>),
|
||||
pub struct ConstraintExpressionDisable {
|
||||
pub nodes: (Keyword, Keyword, ConstraintPrimary, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UniquenessConstraint<'a> {
|
||||
pub nodes: (Keyword<'a>, Brace<'a, OpenRangeList<'a>>),
|
||||
pub struct UniquenessConstraint {
|
||||
pub nodes: (Keyword, Brace< OpenRangeList>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstraintSet<'a> {
|
||||
ConstraintExpression(Box<ConstraintExpression<'a>>),
|
||||
Brace(ConstraintSetBrace<'a>),
|
||||
pub enum ConstraintSet {
|
||||
ConstraintExpression(Box<ConstraintExpression>),
|
||||
Brace(ConstraintSetBrace),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintSetBrace<'a> {
|
||||
pub nodes: (Brace<'a, Vec<ConstraintExpression<'a>>>,),
|
||||
pub struct ConstraintSetBrace {
|
||||
pub nodes: (Brace< Vec<ConstraintExpression>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DistList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, DistItem<'a>>,),
|
||||
pub struct DistList {
|
||||
pub nodes: (List<Symbol, DistItem>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DistItem<'a> {
|
||||
pub nodes: (ValueRange<'a>, Option<DistWeight<'a>>),
|
||||
pub struct DistItem {
|
||||
pub nodes: (ValueRange, Option<DistWeight>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DistWeight<'a> {
|
||||
Equal(DistWeightEqual<'a>),
|
||||
Divide(DistWeightDivide<'a>),
|
||||
pub enum DistWeight {
|
||||
Equal(DistWeightEqual),
|
||||
Divide(DistWeightDivide),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DistWeightEqual<'a> {
|
||||
pub nodes: (Symbol<'a>, Expression<'a>),
|
||||
pub struct DistWeightEqual {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DistWeightDivide<'a> {
|
||||
pub nodes: (Symbol<'a>, Expression<'a>),
|
||||
pub struct DistWeightDivide {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ConstraintPrototype<'a> {
|
||||
pub struct ConstraintPrototype {
|
||||
pub nodes: (
|
||||
Option<ConstraintPrototypeQualifier<'a>>,
|
||||
Option<Static<'a>>,
|
||||
Keyword<'a>,
|
||||
ConstraintIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Option<ConstraintPrototypeQualifier>,
|
||||
Option<Static>,
|
||||
Keyword,
|
||||
ConstraintIdentifier,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ConstraintPrototypeQualifier<'a> {
|
||||
Extern(Keyword<'a>),
|
||||
Pure(Keyword<'a>),
|
||||
pub enum ConstraintPrototypeQualifier {
|
||||
Extern(Keyword),
|
||||
Pure(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExternConstraintDeclaration<'a> {
|
||||
pub struct ExternConstraintDeclaration {
|
||||
pub nodes: (
|
||||
Option<Static<'a>>,
|
||||
Keyword<'a>,
|
||||
ClassScope<'a>,
|
||||
ConstraintIdentifier<'a>,
|
||||
ConstraintBlock<'a>,
|
||||
Option<Static>,
|
||||
Keyword,
|
||||
ClassScope,
|
||||
ConstraintIdentifier,
|
||||
ConstraintBlock,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IdentifierList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, Identifier<'a>>,),
|
||||
pub struct IdentifierList {
|
||||
pub nodes: (List<Symbol, Identifier>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,51 +9,51 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfaceOrGenerateItem<'a> {
|
||||
Module(InterfaceOrGenerateItemModule<'a>),
|
||||
Extern(InterfaceOrGenerateItemExtern<'a>),
|
||||
pub enum InterfaceOrGenerateItem {
|
||||
Module(InterfaceOrGenerateItemModule),
|
||||
Extern(InterfaceOrGenerateItemExtern),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceOrGenerateItemModule<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ModuleCommonItem<'a>),
|
||||
pub struct InterfaceOrGenerateItemModule {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleCommonItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceOrGenerateItemExtern<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ExternTfDeclaration<'a>),
|
||||
pub struct InterfaceOrGenerateItemExtern {
|
||||
pub nodes: (Vec<AttributeInstance>, ExternTfDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ExternTfDeclaration<'a> {
|
||||
Method(ExternTfDeclarationMethod<'a>),
|
||||
Task(ExternTfDeclarationTask<'a>),
|
||||
pub enum ExternTfDeclaration {
|
||||
Method(ExternTfDeclarationMethod),
|
||||
Task(ExternTfDeclarationTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExternTfDeclarationMethod<'a> {
|
||||
pub nodes: (Keyword<'a>, MethodPrototype<'a>, Symbol<'a>),
|
||||
pub struct ExternTfDeclarationMethod {
|
||||
pub nodes: (Keyword, MethodPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ExternTfDeclarationTask<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, TaskPrototype<'a>, Symbol<'a>),
|
||||
pub struct ExternTfDeclarationTask {
|
||||
pub nodes: (Keyword, Keyword, TaskPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfaceItem<'a> {
|
||||
PortDeclaration((PortDeclaration<'a>, Symbol<'a>)),
|
||||
NonPortInterfaceItem(NonPortInterfaceItem<'a>),
|
||||
pub enum InterfaceItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortInterfaceItem(NonPortInterfaceItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NonPortInterfaceItem<'a> {
|
||||
GenerateRegion(GenerateRegion<'a>),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>),
|
||||
ProgramDeclaration(ProgramDeclaration<'a>),
|
||||
ModportDeclaration(ModportDeclaration<'a>),
|
||||
InterfaceDeclaration(InterfaceDeclaration<'a>),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
|
||||
pub enum NonPortInterfaceItem {
|
||||
GenerateRegion(GenerateRegion),
|
||||
InterfaceOrGenerateItem(InterfaceOrGenerateItem),
|
||||
ProgramDeclaration(ProgramDeclaration),
|
||||
ModportDeclaration(ModportDeclaration),
|
||||
InterfaceDeclaration(InterfaceDeclaration),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,37 +9,37 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LibraryText<'a> {
|
||||
pub nodes: (Vec<LibraryDescription<'a>>,),
|
||||
pub struct LibraryText {
|
||||
pub nodes: (Vec<LibraryDescription>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum LibraryDescription<'a> {
|
||||
LibraryDeclaration(LibraryDeclaration<'a>),
|
||||
IncludeStatement(IncludeStatement<'a>),
|
||||
ConfigDeclaration(ConfigDeclaration<'a>),
|
||||
Null(Symbol<'a>),
|
||||
pub enum LibraryDescription {
|
||||
LibraryDeclaration(LibraryDeclaration),
|
||||
IncludeStatement(IncludeStatement),
|
||||
ConfigDeclaration(ConfigDeclaration),
|
||||
Null(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LibraryDeclaration<'a> {
|
||||
pub struct LibraryDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
LibraryIdentifier<'a>,
|
||||
List<Symbol<'a>, FilePathSpec<'a>>,
|
||||
Option<(Keyword<'a>, List<Symbol<'a>, FilePathSpec<'a>>)>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
LibraryIdentifier,
|
||||
List<Symbol, FilePathSpec>,
|
||||
Option<(Keyword, List<Symbol, FilePathSpec>)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct IncludeStatement<'a> {
|
||||
pub nodes: (Keyword<'a>, FilePathSpec<'a>, Symbol<'a>),
|
||||
pub struct IncludeStatement {
|
||||
pub nodes: (Keyword, FilePathSpec, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FilePathSpec<'a> {
|
||||
pub nodes: (StringLiteral<'a>,),
|
||||
pub struct FilePathSpec {
|
||||
pub nodes: (StringLiteral,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,209 +9,209 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ElaborationSystemTask<'a> {
|
||||
Fatal(ElaborationSystemTaskFatal<'a>),
|
||||
Error(ElaborationSystemTaskError<'a>),
|
||||
Warning(ElaborationSystemTaskWarning<'a>),
|
||||
Info(ElaborationSystemTaskInfo<'a>),
|
||||
pub enum ElaborationSystemTask {
|
||||
Fatal(ElaborationSystemTaskFatal),
|
||||
Error(ElaborationSystemTaskError),
|
||||
Warning(ElaborationSystemTaskWarning),
|
||||
Info(ElaborationSystemTaskInfo),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ElaborationSystemTaskFatal<'a> {
|
||||
pub struct ElaborationSystemTaskFatal {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, (FinishNumber<'a>, Option<(Symbol<'a>, ListOfArguments<'a>)>)>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<Paren< (FinishNumber, Option<(Symbol, ListOfArguments)>)>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ElaborationSystemTaskError<'a> {
|
||||
pub struct ElaborationSystemTaskError {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<ListOfArguments<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ElaborationSystemTaskWarning<'a> {
|
||||
pub struct ElaborationSystemTaskWarning {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<ListOfArguments<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ElaborationSystemTaskInfo<'a> {
|
||||
pub struct ElaborationSystemTaskInfo {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Option<Paren<'a, Option<ListOfArguments<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Option<Paren< Option<ListOfArguments>>>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum FinishNumber<'a> {
|
||||
Zero(Symbol<'a>),
|
||||
One(Symbol<'a>),
|
||||
Two(Symbol<'a>),
|
||||
pub enum FinishNumber {
|
||||
Zero(Symbol),
|
||||
One(Symbol),
|
||||
Two(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleCommonItem<'a> {
|
||||
ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration<'a>),
|
||||
InterfaceInstantiation(InterfaceInstantiation<'a>),
|
||||
ProgramInstantiation(ProgramInstantiation<'a>),
|
||||
AssertionItem(AssertionItem<'a>),
|
||||
BindDirective(BindDirective<'a>),
|
||||
ContinuousAssign(ContinuousAssign<'a>),
|
||||
NetAlias(NetAlias<'a>),
|
||||
InitialConstruct(InitialConstruct<'a>),
|
||||
FinalConstruct(FinalConstruct<'a>),
|
||||
AlwaysConstruct(AlwaysConstruct<'a>),
|
||||
LoopGenerateConstruct(Box<LoopGenerateConstruct<'a>>),
|
||||
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct<'a>>),
|
||||
ElaborationSystemTask(ElaborationSystemTask<'a>),
|
||||
pub enum ModuleCommonItem {
|
||||
ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration),
|
||||
InterfaceInstantiation(InterfaceInstantiation),
|
||||
ProgramInstantiation(ProgramInstantiation),
|
||||
AssertionItem(AssertionItem),
|
||||
BindDirective(BindDirective),
|
||||
ContinuousAssign(ContinuousAssign),
|
||||
NetAlias(NetAlias),
|
||||
InitialConstruct(InitialConstruct),
|
||||
FinalConstruct(FinalConstruct),
|
||||
AlwaysConstruct(AlwaysConstruct),
|
||||
LoopGenerateConstruct(Box<LoopGenerateConstruct>),
|
||||
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct>),
|
||||
ElaborationSystemTask(ElaborationSystemTask),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleItem<'a> {
|
||||
PortDeclaration((PortDeclaration<'a>, Symbol<'a>)),
|
||||
NonPortModuleItem(NonPortModuleItem<'a>),
|
||||
pub enum ModuleItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortModuleItem(NonPortModuleItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleOrGenerateItem<'a> {
|
||||
Parameter(ModuleOrGenerateItemParameter<'a>),
|
||||
Gate(ModuleOrGenerateItemGate<'a>),
|
||||
Udp(ModuleOrGenerateItemUdp<'a>),
|
||||
Module(ModuleOrGenerateItemModule<'a>),
|
||||
ModuleItem(Box<ModuleOrGenerateItemModuleItem<'a>>),
|
||||
pub enum ModuleOrGenerateItem {
|
||||
Parameter(ModuleOrGenerateItemParameter),
|
||||
Gate(ModuleOrGenerateItemGate),
|
||||
Udp(ModuleOrGenerateItemUdp),
|
||||
Module(ModuleOrGenerateItemModule),
|
||||
ModuleItem(Box<ModuleOrGenerateItemModuleItem>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemParameter<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ParameterOverride<'a>),
|
||||
pub struct ModuleOrGenerateItemParameter {
|
||||
pub nodes: (Vec<AttributeInstance>, ParameterOverride),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemGate<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, GateInstantiation<'a>),
|
||||
pub struct ModuleOrGenerateItemGate {
|
||||
pub nodes: (Vec<AttributeInstance>, GateInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemUdp<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, UdpInstantiation<'a>),
|
||||
pub struct ModuleOrGenerateItemUdp {
|
||||
pub nodes: (Vec<AttributeInstance>, UdpInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemModule<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ModuleInstantiation<'a>),
|
||||
pub struct ModuleOrGenerateItemModule {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemModuleItem<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ModuleCommonItem<'a>),
|
||||
pub struct ModuleOrGenerateItemModuleItem {
|
||||
pub nodes: (Vec<AttributeInstance>, ModuleCommonItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleOrGenerateItemDeclaration<'a> {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>),
|
||||
GenvarDeclaration(GenvarDeclaration<'a>),
|
||||
ClockingDeclaration(ClockingDeclaration<'a>),
|
||||
Clocking(ModuleOrGenerateItemDeclarationClocking<'a>),
|
||||
Disable(ModuleOrGenerateItemDeclarationDisable<'a>),
|
||||
pub enum ModuleOrGenerateItemDeclaration {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration),
|
||||
GenvarDeclaration(GenvarDeclaration),
|
||||
ClockingDeclaration(ClockingDeclaration),
|
||||
Clocking(ModuleOrGenerateItemDeclarationClocking),
|
||||
Disable(ModuleOrGenerateItemDeclarationDisable),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemDeclarationClocking<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>),
|
||||
pub struct ModuleOrGenerateItemDeclarationClocking {
|
||||
pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleOrGenerateItemDeclarationDisable<'a> {
|
||||
pub struct ModuleOrGenerateItemDeclarationDisable {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
ExpressionOrDist<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
Keyword,
|
||||
ExpressionOrDist,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NonPortModuleItem<'a> {
|
||||
GenerateRegion(GenerateRegion<'a>),
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem<'a>),
|
||||
SpecifyBlock(SpecifyBlock<'a>),
|
||||
Specparam(NonPortModuleItemSpecparam<'a>),
|
||||
ProgramDeclaration(ProgramDeclaration<'a>),
|
||||
ModuleDeclaration(ModuleDeclaration<'a>),
|
||||
InterfaceDeclaration(InterfaceDeclaration<'a>),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
|
||||
pub enum NonPortModuleItem {
|
||||
GenerateRegion(GenerateRegion),
|
||||
ModuleOrGenerateItem(ModuleOrGenerateItem),
|
||||
SpecifyBlock(SpecifyBlock),
|
||||
Specparam(NonPortModuleItemSpecparam),
|
||||
ProgramDeclaration(ProgramDeclaration),
|
||||
ModuleDeclaration(ModuleDeclaration),
|
||||
InterfaceDeclaration(InterfaceDeclaration),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortModuleItemSpecparam<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, SpecparamDeclaration<'a>),
|
||||
pub struct NonPortModuleItemSpecparam {
|
||||
pub nodes: (Vec<AttributeInstance>, SpecparamDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterOverride<'a> {
|
||||
pub nodes: (Keyword<'a>, ListOfDefparamAssignments<'a>, Symbol<'a>),
|
||||
pub struct ParameterOverride {
|
||||
pub nodes: (Keyword, ListOfDefparamAssignments, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BindDirective<'a> {
|
||||
Scope(BindDirectiveScope<'a>),
|
||||
Instance(BindDirectiveInstance<'a>),
|
||||
pub enum BindDirective {
|
||||
Scope(BindDirectiveScope),
|
||||
Instance(BindDirectiveInstance),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BindDirectiveScope<'a> {
|
||||
pub struct BindDirectiveScope {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
BindTargetScope<'a>,
|
||||
Option<(Symbol<'a>, BindTargetInstanceList<'a>)>,
|
||||
BindInstantiation<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
BindTargetScope,
|
||||
Option<(Symbol, BindTargetInstanceList)>,
|
||||
BindInstantiation,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BindDirectiveInstance<'a> {
|
||||
pub struct BindDirectiveInstance {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
BindTargetInstance<'a>,
|
||||
BindInstantiation<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
BindTargetInstance,
|
||||
BindInstantiation,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BindTargetScope<'a> {
|
||||
ModuleIdentifier(ModuleIdentifier<'a>),
|
||||
InterfaceIdentifier(InterfaceIdentifier<'a>),
|
||||
pub enum BindTargetScope {
|
||||
ModuleIdentifier(ModuleIdentifier),
|
||||
InterfaceIdentifier(InterfaceIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BindTargetInstance<'a> {
|
||||
pub nodes: (HierarchicalIdentifier<'a>, ConstantBitSelect<'a>),
|
||||
pub struct BindTargetInstance {
|
||||
pub nodes: (HierarchicalIdentifier, ConstantBitSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct BindTargetInstanceList<'a> {
|
||||
pub nodes: (List<Symbol<'a>, BindTargetInstance<'a>>,),
|
||||
pub struct BindTargetInstanceList {
|
||||
pub nodes: (List<Symbol, BindTargetInstance>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum BindInstantiation<'a> {
|
||||
ProgramInstantiation(ProgramInstantiation<'a>),
|
||||
ModuleInstantiation(ModuleInstantiation<'a>),
|
||||
InterfaceInstantiation(InterfaceInstantiation<'a>),
|
||||
CheckerInstantiation(CheckerInstantiation<'a>),
|
||||
pub enum BindInstantiation {
|
||||
ProgramInstantiation(ProgramInstantiation),
|
||||
ModuleInstantiation(ModuleInstantiation),
|
||||
InterfaceInstantiation(InterfaceInstantiation),
|
||||
CheckerInstantiation(CheckerInstantiation),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,210 +9,210 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ParameterPortList<'a> {
|
||||
Assignment(ParameterPortListAssignment<'a>),
|
||||
Declaration(ParameterPortListDeclaration<'a>),
|
||||
Empty((Symbol<'a>, Symbol<'a>, Symbol<'a>)),
|
||||
pub enum ParameterPortList {
|
||||
Assignment(ParameterPortListAssignment),
|
||||
Declaration(ParameterPortListDeclaration),
|
||||
Empty((Symbol, Symbol, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterPortListAssignment<'a> {
|
||||
pub struct ParameterPortListAssignment {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Symbol,
|
||||
Paren<
|
||||
'a,
|
||||
|
||||
(
|
||||
ListOfParamAssignments<'a>,
|
||||
Vec<(Symbol<'a>, ParameterPortDeclaration<'a>)>,
|
||||
ListOfParamAssignments,
|
||||
Vec<(Symbol, ParameterPortDeclaration)>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterPortListDeclaration<'a> {
|
||||
pub struct ParameterPortListDeclaration {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
Paren<'a, List<Symbol<'a>, ParameterPortDeclaration<'a>>>,
|
||||
Symbol,
|
||||
Paren< List<Symbol, ParameterPortDeclaration>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ParameterPortDeclaration<'a> {
|
||||
ParameterDeclaration(ParameterDeclaration<'a>),
|
||||
LocalParameterDeclaration(LocalParameterDeclaration<'a>),
|
||||
ParamList(ParameterPortDeclarationParamList<'a>),
|
||||
TypeList(ParameterPortDeclarationTypeList<'a>),
|
||||
pub enum ParameterPortDeclaration {
|
||||
ParameterDeclaration(ParameterDeclaration),
|
||||
LocalParameterDeclaration(LocalParameterDeclaration),
|
||||
ParamList(ParameterPortDeclarationParamList),
|
||||
TypeList(ParameterPortDeclarationTypeList),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterPortDeclarationParamList<'a> {
|
||||
pub nodes: (DataType<'a>, ListOfParamAssignments<'a>),
|
||||
pub struct ParameterPortDeclarationParamList {
|
||||
pub nodes: (DataType, ListOfParamAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParameterPortDeclarationTypeList<'a> {
|
||||
pub nodes: (Keyword<'a>, ListOfTypeAssignments<'a>),
|
||||
pub struct ParameterPortDeclarationTypeList {
|
||||
pub nodes: (Keyword, ListOfTypeAssignments),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPorts<'a> {
|
||||
pub nodes: (Paren<'a, List<Symbol<'a>, Port<'a>>>,),
|
||||
pub struct ListOfPorts {
|
||||
pub nodes: (Paren< List<Symbol, Port>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPortDeclarations<'a> {
|
||||
pub struct ListOfPortDeclarations {
|
||||
pub nodes: (
|
||||
Paren<'a, Option<List<Symbol<'a>, (Vec<AttributeInstance<'a>>, AnsiPortDeclaration<'a>)>>>,
|
||||
Paren< Option<List<Symbol, (Vec<AttributeInstance>, AnsiPortDeclaration)>>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PortDeclaration<'a> {
|
||||
Inout(PortDeclarationInout<'a>),
|
||||
Input(PortDeclarationInput<'a>),
|
||||
Output(PortDeclarationOutput<'a>),
|
||||
Ref(PortDeclarationRef<'a>),
|
||||
Interface(PortDeclarationInterface<'a>),
|
||||
pub enum PortDeclaration {
|
||||
Inout(PortDeclarationInout),
|
||||
Input(PortDeclarationInput),
|
||||
Output(PortDeclarationOutput),
|
||||
Ref(PortDeclarationRef),
|
||||
Interface(PortDeclarationInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortDeclarationInout<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, InoutDeclaration<'a>),
|
||||
pub struct PortDeclarationInout {
|
||||
pub nodes: (Vec<AttributeInstance>, InoutDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortDeclarationInput<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, InputDeclaration<'a>),
|
||||
pub struct PortDeclarationInput {
|
||||
pub nodes: (Vec<AttributeInstance>, InputDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortDeclarationOutput<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, OutputDeclaration<'a>),
|
||||
pub struct PortDeclarationOutput {
|
||||
pub nodes: (Vec<AttributeInstance>, OutputDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortDeclarationRef<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, RefDeclaration<'a>),
|
||||
pub struct PortDeclarationRef {
|
||||
pub nodes: (Vec<AttributeInstance>, RefDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortDeclarationInterface<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, InterfacePortDeclaration<'a>),
|
||||
pub struct PortDeclarationInterface {
|
||||
pub nodes: (Vec<AttributeInstance>, InterfacePortDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Port<'a> {
|
||||
NonNamed(PortNonNamed<'a>),
|
||||
Named(PortNamed<'a>),
|
||||
pub enum Port {
|
||||
NonNamed(PortNonNamed),
|
||||
Named(PortNamed),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortNonNamed<'a> {
|
||||
pub nodes: (Option<PortExpression<'a>>,),
|
||||
pub struct PortNonNamed {
|
||||
pub nodes: (Option<PortExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortNamed<'a> {
|
||||
pub struct PortNamed {
|
||||
pub nodes: (
|
||||
Symbol<'a>,
|
||||
PortIdentifier<'a>,
|
||||
Paren<'a, Option<PortExpression<'a>>>,
|
||||
Symbol,
|
||||
PortIdentifier,
|
||||
Paren< Option<PortExpression>>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PortExpression<'a> {
|
||||
PortReference(PortReference<'a>),
|
||||
Brace(PortExpressionBrace<'a>),
|
||||
pub enum PortExpression {
|
||||
PortReference(PortReference),
|
||||
Brace(PortExpressionBrace),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortExpressionBrace<'a> {
|
||||
pub nodes: (Brace<'a, List<Symbol<'a>, PortReference<'a>>>,),
|
||||
pub struct PortExpressionBrace {
|
||||
pub nodes: (Brace< List<Symbol, PortReference>>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PortReference<'a> {
|
||||
pub nodes: (PortIdentifier<'a>, ConstantSelect<'a>),
|
||||
pub struct PortReference {
|
||||
pub nodes: (PortIdentifier, ConstantSelect),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PortDirection<'a> {
|
||||
Input(Keyword<'a>),
|
||||
Output(Keyword<'a>),
|
||||
Inout(Keyword<'a>),
|
||||
Ref(Keyword<'a>),
|
||||
pub enum PortDirection {
|
||||
Input(Keyword),
|
||||
Output(Keyword),
|
||||
Inout(Keyword),
|
||||
Ref(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NetPortHeader<'a> {
|
||||
pub nodes: (Option<PortDirection<'a>>, NetPortType<'a>),
|
||||
pub struct NetPortHeader {
|
||||
pub nodes: (Option<PortDirection>, NetPortType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct VariablePortHeader<'a> {
|
||||
pub nodes: (Option<PortDirection<'a>>, VariablePortType<'a>),
|
||||
pub struct VariablePortHeader {
|
||||
pub nodes: (Option<PortDirection>, VariablePortType),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfacePortHeader<'a> {
|
||||
Identifier(InterfacePortHeaderIdentifier<'a>),
|
||||
Interface(InterfacePortHeaderInterface<'a>),
|
||||
pub enum InterfacePortHeader {
|
||||
Identifier(InterfacePortHeaderIdentifier),
|
||||
Interface(InterfacePortHeaderInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfacePortHeaderIdentifier<'a> {
|
||||
pub struct InterfacePortHeaderIdentifier {
|
||||
pub nodes: (
|
||||
InterfaceIdentifier<'a>,
|
||||
Option<(Symbol<'a>, ModportIdentifier<'a>)>,
|
||||
InterfaceIdentifier,
|
||||
Option<(Symbol, ModportIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfacePortHeaderInterface<'a> {
|
||||
pub nodes: (Keyword<'a>, Option<(Symbol<'a>, ModportIdentifier<'a>)>),
|
||||
pub struct InterfacePortHeaderInterface {
|
||||
pub nodes: (Keyword, Option<(Symbol, ModportIdentifier)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NetPortHeaderOrInterfacePortHeader<'a> {
|
||||
NetPortHeader(NetPortHeader<'a>),
|
||||
InterfacePortHeader(InterfacePortHeader<'a>),
|
||||
pub enum NetPortHeaderOrInterfacePortHeader {
|
||||
NetPortHeader(NetPortHeader),
|
||||
InterfacePortHeader(InterfacePortHeader),
|
||||
}
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AnsiPortDeclaration<'a> {
|
||||
Net(AnsiPortDeclarationNet<'a>),
|
||||
Variable(AnsiPortDeclarationVariable<'a>),
|
||||
Paren(AnsiPortDeclarationParen<'a>),
|
||||
pub enum AnsiPortDeclaration {
|
||||
Net(AnsiPortDeclarationNet),
|
||||
Variable(AnsiPortDeclarationVariable),
|
||||
Paren(AnsiPortDeclarationParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AnsiPortDeclarationNet<'a> {
|
||||
pub struct AnsiPortDeclarationNet {
|
||||
pub nodes: (
|
||||
Option<NetPortHeaderOrInterfacePortHeader<'a>>,
|
||||
PortIdentifier<'a>,
|
||||
Vec<UnpackedDimension<'a>>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
Option<NetPortHeaderOrInterfacePortHeader>,
|
||||
PortIdentifier,
|
||||
Vec<UnpackedDimension>,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AnsiPortDeclarationVariable<'a> {
|
||||
pub struct AnsiPortDeclarationVariable {
|
||||
pub nodes: (
|
||||
Option<VariablePortHeader<'a>>,
|
||||
PortIdentifier<'a>,
|
||||
Vec<VariableDimension<'a>>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
Option<VariablePortHeader>,
|
||||
PortIdentifier,
|
||||
Vec<VariableDimension>,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AnsiPortDeclarationParen<'a> {
|
||||
pub struct AnsiPortDeclarationParen {
|
||||
pub nodes: (
|
||||
Option<PortDirection<'a>>,
|
||||
Symbol<'a>,
|
||||
PortIdentifier<'a>,
|
||||
Paren<'a, Option<Expression<'a>>>,
|
||||
Option<PortDirection>,
|
||||
Symbol,
|
||||
PortIdentifier,
|
||||
Paren< Option<Expression>>,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -9,49 +9,49 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageItem<'a> {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>),
|
||||
AnonymousProgram(AnonymousProgram<'a>),
|
||||
PackageExportDeclaration(PackageExportDeclaration<'a>),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
|
||||
pub enum PackageItem {
|
||||
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration),
|
||||
AnonymousProgram(AnonymousProgram),
|
||||
PackageExportDeclaration(PackageExportDeclaration),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PackageOrGenerateItemDeclaration<'a> {
|
||||
NetDeclaration(NetDeclaration<'a>),
|
||||
DataDeclaration(DataDeclaration<'a>),
|
||||
TaskDeclaration(TaskDeclaration<'a>),
|
||||
FunctionDeclaration(FunctionDeclaration<'a>),
|
||||
CheckerDeclaration(CheckerDeclaration<'a>),
|
||||
DpiImportExport(DpiImportExport<'a>),
|
||||
ExternConstraintDeclaration(ExternConstraintDeclaration<'a>),
|
||||
ClassDeclaration(ClassDeclaration<'a>),
|
||||
ClassConstructorDeclaration(ClassConstructorDeclaration<'a>),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)),
|
||||
ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)),
|
||||
CovergroupDeclaration(CovergroupDeclaration<'a>),
|
||||
AssertionItemDeclaration(AssertionItemDeclaration<'a>),
|
||||
Empty(Symbol<'a>),
|
||||
pub enum PackageOrGenerateItemDeclaration {
|
||||
NetDeclaration(NetDeclaration),
|
||||
DataDeclaration(DataDeclaration),
|
||||
TaskDeclaration(TaskDeclaration),
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
CheckerDeclaration(CheckerDeclaration),
|
||||
DpiImportExport(DpiImportExport),
|
||||
ExternConstraintDeclaration(ExternConstraintDeclaration),
|
||||
ClassDeclaration(ClassDeclaration),
|
||||
ClassConstructorDeclaration(ClassConstructorDeclaration),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration, Symbol)),
|
||||
ParameterDeclaration((ParameterDeclaration, Symbol)),
|
||||
CovergroupDeclaration(CovergroupDeclaration),
|
||||
AssertionItemDeclaration(AssertionItemDeclaration),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct AnonymousProgram<'a> {
|
||||
pub struct AnonymousProgram {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AnonymousProgramItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
Symbol,
|
||||
Vec<AnonymousProgramItem>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum AnonymousProgramItem<'a> {
|
||||
TaskDeclaration(TaskDeclaration<'a>),
|
||||
FunctionDeclaration(FunctionDeclaration<'a>),
|
||||
ClassDeclaration(ClassDeclaration<'a>),
|
||||
CovergroupDeclaration(CovergroupDeclaration<'a>),
|
||||
ClassConstructorDeclaration(ClassConstructorDeclaration<'a>),
|
||||
Empty(Symbol<'a>),
|
||||
pub enum AnonymousProgramItem {
|
||||
TaskDeclaration(TaskDeclaration),
|
||||
FunctionDeclaration(FunctionDeclaration),
|
||||
ClassDeclaration(ClassDeclaration),
|
||||
CovergroupDeclaration(CovergroupDeclaration),
|
||||
ClassConstructorDeclaration(ClassConstructorDeclaration),
|
||||
Empty(Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,56 +9,56 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProgramItem<'a> {
|
||||
PortDeclaration((PortDeclaration<'a>, Symbol<'a>)),
|
||||
NonPortProgramItem(NonPortProgramItem<'a>),
|
||||
pub enum ProgramItem {
|
||||
PortDeclaration((PortDeclaration, Symbol)),
|
||||
NonPortProgramItem(NonPortProgramItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NonPortProgramItem<'a> {
|
||||
Assign(NonPortProgramItemAssign<'a>),
|
||||
Module(NonPortProgramItemModule<'a>),
|
||||
Initial(NonPortProgramItemInitial<'a>),
|
||||
Final(NonPortProgramItemFinal<'a>),
|
||||
Assertion(NonPortProgramItemAssertion<'a>),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
|
||||
ProgramGenerateItem(ProgramGenerateItem<'a>),
|
||||
pub enum NonPortProgramItem {
|
||||
Assign(NonPortProgramItemAssign),
|
||||
Module(NonPortProgramItemModule),
|
||||
Initial(NonPortProgramItemInitial),
|
||||
Final(NonPortProgramItemFinal),
|
||||
Assertion(NonPortProgramItemAssertion),
|
||||
TimeunitsDeclaration(TimeunitsDeclaration),
|
||||
ProgramGenerateItem(ProgramGenerateItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortProgramItemAssign<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ContinuousAssign<'a>),
|
||||
pub struct NonPortProgramItemAssign {
|
||||
pub nodes: (Vec<AttributeInstance>, ContinuousAssign),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortProgramItemModule<'a> {
|
||||
pub struct NonPortProgramItemModule {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModuleOrGenerateItemDeclaration<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
ModuleOrGenerateItemDeclaration,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortProgramItemInitial<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, InitialConstruct<'a>),
|
||||
pub struct NonPortProgramItemInitial {
|
||||
pub nodes: (Vec<AttributeInstance>, InitialConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortProgramItemFinal<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, FinalConstruct<'a>),
|
||||
pub struct NonPortProgramItemFinal {
|
||||
pub nodes: (Vec<AttributeInstance>, FinalConstruct),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NonPortProgramItemAssertion<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, ConcurrentAssertionItem<'a>),
|
||||
pub struct NonPortProgramItemAssertion {
|
||||
pub nodes: (Vec<AttributeInstance>, ConcurrentAssertionItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProgramGenerateItem<'a> {
|
||||
LoopGenerateConstruct(LoopGenerateConstruct<'a>),
|
||||
ConditionalGenerateConstruct(ConditionalGenerateConstruct<'a>),
|
||||
GenerateRegion(GenerateRegion<'a>),
|
||||
ElaborationSystemTask(ElaborationSystemTask<'a>),
|
||||
pub enum ProgramGenerateItem {
|
||||
LoopGenerateConstruct(LoopGenerateConstruct),
|
||||
ConditionalGenerateConstruct(ConditionalGenerateConstruct),
|
||||
GenerateRegion(GenerateRegion),
|
||||
ElaborationSystemTask(ElaborationSystemTask),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,429 +9,429 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SourceText<'a> {
|
||||
pub nodes: (Option<TimeunitsDeclaration<'a>>, Vec<Description<'a>>),
|
||||
pub struct SourceText {
|
||||
pub nodes: (Option<TimeunitsDeclaration>, Vec<Description>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum Description<'a> {
|
||||
ModuleDeclaration(ModuleDeclaration<'a>),
|
||||
UdpDeclaration(UdpDeclaration<'a>),
|
||||
InterfaceDeclaration(InterfaceDeclaration<'a>),
|
||||
ProgramDeclaration(ProgramDeclaration<'a>),
|
||||
PackageDeclaration(PackageDeclaration<'a>),
|
||||
PackageItem(DescriptionPackageItem<'a>),
|
||||
BindDirective(DescriptionBindDirective<'a>),
|
||||
ConfigDeclaration(ConfigDeclaration<'a>),
|
||||
pub enum Description {
|
||||
ModuleDeclaration(ModuleDeclaration),
|
||||
UdpDeclaration(UdpDeclaration),
|
||||
InterfaceDeclaration(InterfaceDeclaration),
|
||||
ProgramDeclaration(ProgramDeclaration),
|
||||
PackageDeclaration(PackageDeclaration),
|
||||
PackageItem(DescriptionPackageItem),
|
||||
BindDirective(DescriptionBindDirective),
|
||||
ConfigDeclaration(ConfigDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DescriptionPackageItem<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, PackageItem<'a>),
|
||||
pub struct DescriptionPackageItem {
|
||||
pub nodes: (Vec<AttributeInstance>, PackageItem),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DescriptionBindDirective<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, BindDirective<'a>),
|
||||
pub struct DescriptionBindDirective {
|
||||
pub nodes: (Vec<AttributeInstance>, BindDirective),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleNonansiHeader<'a> {
|
||||
pub struct ModuleNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModuleKeyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ModuleIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
ListOfPorts<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
ModuleKeyword,
|
||||
Option<Lifetime>,
|
||||
ModuleIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
ListOfPorts,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleAnsiHeader<'a> {
|
||||
pub struct ModuleAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModuleKeyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ModuleIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
Option<ListOfPortDeclarations<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
ModuleKeyword,
|
||||
Option<Lifetime>,
|
||||
ModuleIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
Option<ListOfPortDeclarations>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleDeclaration<'a> {
|
||||
Nonansi(ModuleDeclarationNonansi<'a>),
|
||||
Ansi(ModuleDeclarationAnsi<'a>),
|
||||
Wildcard(ModuleDeclarationWildcard<'a>),
|
||||
ExternNonansi(ModuleDeclarationExternNonansi<'a>),
|
||||
ExternAnsi(ModuleDeclarationExternAnsi<'a>),
|
||||
pub enum ModuleDeclaration {
|
||||
Nonansi(ModuleDeclarationNonansi),
|
||||
Ansi(ModuleDeclarationAnsi),
|
||||
Wildcard(ModuleDeclarationWildcard),
|
||||
ExternNonansi(ModuleDeclarationExternNonansi),
|
||||
ExternAnsi(ModuleDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleDeclarationNonansi<'a> {
|
||||
pub struct ModuleDeclarationNonansi {
|
||||
pub nodes: (
|
||||
ModuleNonansiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<ModuleItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ModuleIdentifier<'a>)>,
|
||||
ModuleNonansiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<ModuleItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ModuleIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleDeclarationAnsi<'a> {
|
||||
pub struct ModuleDeclarationAnsi {
|
||||
pub nodes: (
|
||||
ModuleAnsiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<NonPortModuleItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ModuleIdentifier<'a>)>,
|
||||
ModuleAnsiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<NonPortModuleItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ModuleIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleDeclarationWildcard<'a> {
|
||||
pub struct ModuleDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
ModuleKeyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ModuleIdentifier<'a>,
|
||||
Paren<'a, Symbol<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<ModuleItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ModuleIdentifier<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
ModuleKeyword,
|
||||
Option<Lifetime>,
|
||||
ModuleIdentifier,
|
||||
Paren< Symbol>,
|
||||
Symbol,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<ModuleItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ModuleIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleDeclarationExternNonansi<'a> {
|
||||
pub nodes: (Keyword<'a>, ModuleNonansiHeader<'a>),
|
||||
pub struct ModuleDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, ModuleNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ModuleDeclarationExternAnsi<'a> {
|
||||
pub nodes: (Keyword<'a>, ModuleAnsiHeader<'a>),
|
||||
pub struct ModuleDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, ModuleAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ModuleKeyword<'a> {
|
||||
Module(Keyword<'a>),
|
||||
Macromodule(Keyword<'a>),
|
||||
pub enum ModuleKeyword {
|
||||
Module(Keyword),
|
||||
Macromodule(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfaceDeclaration<'a> {
|
||||
Nonansi(InterfaceDeclarationNonansi<'a>),
|
||||
Ansi(InterfaceDeclarationAnsi<'a>),
|
||||
Wildcard(InterfaceDeclarationWildcard<'a>),
|
||||
ExternNonansi(InterfaceDeclarationExternNonansi<'a>),
|
||||
ExternAnsi(InterfaceDeclarationExternAnsi<'a>),
|
||||
pub enum InterfaceDeclaration {
|
||||
Nonansi(InterfaceDeclarationNonansi),
|
||||
Ansi(InterfaceDeclarationAnsi),
|
||||
Wildcard(InterfaceDeclarationWildcard),
|
||||
ExternNonansi(InterfaceDeclarationExternNonansi),
|
||||
ExternAnsi(InterfaceDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceDeclarationNonansi<'a> {
|
||||
pub struct InterfaceDeclarationNonansi {
|
||||
pub nodes: (
|
||||
InterfaceNonansiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<InterfaceItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, InterfaceIdentifier<'a>)>,
|
||||
InterfaceNonansiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<InterfaceItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, InterfaceIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceDeclarationAnsi<'a> {
|
||||
pub struct InterfaceDeclarationAnsi {
|
||||
pub nodes: (
|
||||
InterfaceAnsiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<NonPortInterfaceItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, InterfaceIdentifier<'a>)>,
|
||||
InterfaceAnsiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<NonPortInterfaceItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, InterfaceIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceDeclarationWildcard<'a> {
|
||||
pub struct InterfaceDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
InterfaceIdentifier<'a>,
|
||||
Paren<'a, Symbol<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<InterfaceItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, InterfaceIdentifier<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
InterfaceIdentifier,
|
||||
Paren< Symbol>,
|
||||
Symbol,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<InterfaceItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, InterfaceIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceDeclarationExternNonansi<'a> {
|
||||
pub nodes: (Keyword<'a>, InterfaceNonansiHeader<'a>),
|
||||
pub struct InterfaceDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, InterfaceNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceDeclarationExternAnsi<'a> {
|
||||
pub nodes: (Keyword<'a>, InterfaceAnsiHeader<'a>),
|
||||
pub struct InterfaceDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, InterfaceAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceNonansiHeader<'a> {
|
||||
pub struct InterfaceNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
InterfaceIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
ListOfPorts<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
InterfaceIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
ListOfPorts,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceAnsiHeader<'a> {
|
||||
pub struct InterfaceAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
InterfaceIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
Option<ListOfPortDeclarations<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
InterfaceIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
Option<ListOfPortDeclarations>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ProgramDeclaration<'a> {
|
||||
Nonansi(ProgramDeclarationNonansi<'a>),
|
||||
Ansi(ProgramDeclarationAnsi<'a>),
|
||||
Wildcard(ProgramDeclarationWildcard<'a>),
|
||||
ExternNonansi(ProgramDeclarationExternNonansi<'a>),
|
||||
ExternAnsi(ProgramDeclarationExternAnsi<'a>),
|
||||
pub enum ProgramDeclaration {
|
||||
Nonansi(ProgramDeclarationNonansi),
|
||||
Ansi(ProgramDeclarationAnsi),
|
||||
Wildcard(ProgramDeclarationWildcard),
|
||||
ExternNonansi(ProgramDeclarationExternNonansi),
|
||||
ExternAnsi(ProgramDeclarationExternAnsi),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramDeclarationNonansi<'a> {
|
||||
pub struct ProgramDeclarationNonansi {
|
||||
pub nodes: (
|
||||
ProgramNonansiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<ProgramItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ProgramIdentifier<'a>)>,
|
||||
ProgramNonansiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<ProgramItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ProgramIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramDeclarationAnsi<'a> {
|
||||
pub struct ProgramDeclarationAnsi {
|
||||
pub nodes: (
|
||||
ProgramAnsiHeader<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<NonPortProgramItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ProgramIdentifier<'a>)>,
|
||||
ProgramAnsiHeader,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<NonPortProgramItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ProgramIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramDeclarationWildcard<'a> {
|
||||
pub struct ProgramDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
ProgramIdentifier<'a>,
|
||||
Paren<'a, Symbol<'a>>,
|
||||
Symbol<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<ProgramItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ProgramIdentifier<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
ProgramIdentifier,
|
||||
Paren< Symbol>,
|
||||
Symbol,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<ProgramItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ProgramIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramDeclarationExternNonansi<'a> {
|
||||
pub nodes: (Keyword<'a>, ProgramNonansiHeader<'a>),
|
||||
pub struct ProgramDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, ProgramNonansiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramDeclarationExternAnsi<'a> {
|
||||
pub nodes: (Keyword<'a>, ProgramAnsiHeader<'a>),
|
||||
pub struct ProgramDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, ProgramAnsiHeader),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramNonansiHeader<'a> {
|
||||
pub struct ProgramNonansiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ProgramIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
ListOfPorts<'a>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
ProgramIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
ListOfPorts,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ProgramAnsiHeader<'a> {
|
||||
pub struct ProgramAnsiHeader {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ProgramIdentifier<'a>,
|
||||
Vec<PackageImportDeclaration<'a>>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
Option<ListOfPortDeclarations<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
ProgramIdentifier,
|
||||
Vec<PackageImportDeclaration>,
|
||||
Option<ParameterPortList>,
|
||||
Option<ListOfPortDeclarations>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CheckerDeclaration<'a> {
|
||||
pub struct CheckerDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
CheckerIdentifier<'a>,
|
||||
Option<Paren<'a, Option<CheckerPortList<'a>>>>,
|
||||
Symbol<'a>,
|
||||
Vec<(Vec<AttributeInstance<'a>>, CheckerOrGenerateItem<'a>)>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, CheckerIdentifier<'a>)>,
|
||||
Keyword,
|
||||
CheckerIdentifier,
|
||||
Option<Paren< Option<CheckerPortList>>>,
|
||||
Symbol,
|
||||
Vec<(Vec<AttributeInstance>, CheckerOrGenerateItem)>,
|
||||
Keyword,
|
||||
Option<(Symbol, CheckerIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ClassDeclaration<'a> {
|
||||
pub struct ClassDeclaration {
|
||||
pub nodes: (
|
||||
Option<Virtual<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
ClassIdentifier<'a>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
Option<Virtual>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
ClassIdentifier,
|
||||
Option<ParameterPortList>,
|
||||
Option<(
|
||||
Keyword<'a>,
|
||||
ClassType<'a>,
|
||||
Option<Paren<'a, ListOfArguments<'a>>>,
|
||||
Keyword,
|
||||
ClassType,
|
||||
Option<Paren< ListOfArguments>>,
|
||||
)>,
|
||||
Option<(Keyword<'a>, List<Symbol<'a>, InterfaceClassType<'a>>)>,
|
||||
Symbol<'a>,
|
||||
Vec<ClassItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ClassIdentifier<'a>)>,
|
||||
Option<(Keyword, List<Symbol, InterfaceClassType>)>,
|
||||
Symbol,
|
||||
Vec<ClassItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ClassIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Virtual<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct Virtual {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceClassType<'a> {
|
||||
pub nodes: (PsClassIdentifier<'a>, Option<ParameterValueAssignment<'a>>),
|
||||
pub struct InterfaceClassType {
|
||||
pub nodes: (PsClassIdentifier, Option<ParameterValueAssignment>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceClassDeclaration<'a> {
|
||||
pub struct InterfaceClassDeclaration {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
ClassIdentifier<'a>,
|
||||
Option<ParameterPortList<'a>>,
|
||||
Option<(Keyword<'a>, List<Symbol<'a>, InterfaceClassType<'a>>)>,
|
||||
Symbol<'a>,
|
||||
Vec<InterfaceClassItem<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, ClassIdentifier<'a>)>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
ClassIdentifier,
|
||||
Option<ParameterPortList>,
|
||||
Option<(Keyword, List<Symbol, InterfaceClassType>)>,
|
||||
Symbol,
|
||||
Vec<InterfaceClassItem>,
|
||||
Keyword,
|
||||
Option<(Symbol, ClassIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InterfaceClassItem<'a> {
|
||||
TypeDeclaration(TypeDeclaration<'a>),
|
||||
Method(InterfaceClassItemMethod<'a>),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)),
|
||||
ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)),
|
||||
Null(Symbol<'a>),
|
||||
pub enum InterfaceClassItem {
|
||||
TypeDeclaration(TypeDeclaration),
|
||||
Method(InterfaceClassItemMethod),
|
||||
LocalParameterDeclaration((LocalParameterDeclaration, Symbol)),
|
||||
ParameterDeclaration((ParameterDeclaration, Symbol)),
|
||||
Null(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceClassItemMethod<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, InterfaceClassMethod<'a>),
|
||||
pub struct InterfaceClassItemMethod {
|
||||
pub nodes: (Vec<AttributeInstance>, InterfaceClassMethod),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InterfaceClassMethod<'a> {
|
||||
pub nodes: (Keyword<'a>, Keyword<'a>, MethodPrototype<'a>, Symbol<'a>),
|
||||
pub struct InterfaceClassMethod {
|
||||
pub nodes: (Keyword, Keyword, MethodPrototype, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PackageDeclaration<'a> {
|
||||
pub struct PackageDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<Lifetime<'a>>,
|
||||
PackageIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
Option<TimeunitsDeclaration<'a>>,
|
||||
Vec<(Vec<AttributeInstance<'a>>, PackageItem<'a>)>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, PackageIdentifier<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Option<Lifetime>,
|
||||
PackageIdentifier,
|
||||
Symbol,
|
||||
Option<TimeunitsDeclaration>,
|
||||
Vec<(Vec<AttributeInstance>, PackageItem)>,
|
||||
Keyword,
|
||||
Option<(Symbol, PackageIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TimeunitsDeclaration<'a> {
|
||||
Timeunit(TimeunitsDeclarationTimeunit<'a>),
|
||||
Timeprecision(TimeunitsDeclarationTimeprecision<'a>),
|
||||
TimeunitTimeprecision(TimeunitsDeclarationTimeunitTimeprecision<'a>),
|
||||
TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit<'a>),
|
||||
pub enum TimeunitsDeclaration {
|
||||
Timeunit(TimeunitsDeclarationTimeunit),
|
||||
Timeprecision(TimeunitsDeclarationTimeprecision),
|
||||
TimeunitTimeprecision(TimeunitsDeclarationTimeunitTimeprecision),
|
||||
TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeunit<'a> {
|
||||
pub struct TimeunitsDeclarationTimeunit {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
TimeLiteral<'a>,
|
||||
Option<(Symbol<'a>, TimeLiteral<'a>)>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
TimeLiteral,
|
||||
Option<(Symbol, TimeLiteral)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeprecision<'a> {
|
||||
pub nodes: (Keyword<'a>, TimeLiteral<'a>, Symbol<'a>),
|
||||
pub struct TimeunitsDeclarationTimeprecision {
|
||||
pub nodes: (Keyword, TimeLiteral, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> {
|
||||
pub struct TimeunitsDeclarationTimeunitTimeprecision {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
TimeLiteral<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
TimeLiteral<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
TimeLiteral,
|
||||
Symbol,
|
||||
Keyword,
|
||||
TimeLiteral,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeunitsDeclarationTimeprecisionTimeunit<'a> {
|
||||
pub struct TimeunitsDeclarationTimeprecisionTimeunit {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
TimeLiteral<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword<'a>,
|
||||
TimeLiteral<'a>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
TimeLiteral,
|
||||
Symbol,
|
||||
Keyword,
|
||||
TimeLiteral,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -8,27 +8,27 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecifyBlock<'a> {
|
||||
pub nodes: (Keyword<'a>, Vec<SpecifyItem<'a>>, Keyword<'a>),
|
||||
pub struct SpecifyBlock {
|
||||
pub nodes: (Keyword, Vec<SpecifyItem>, Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SpecifyItem<'a> {
|
||||
SpecparamDeclaration(SpecparamDeclaration<'a>),
|
||||
PulsestyleDeclaration(PulsestyleDeclaration<'a>),
|
||||
ShowcancelledDeclaration(ShowcancelledDeclaration<'a>),
|
||||
PathDeclaration(PathDeclaration<'a>),
|
||||
SystemTimingCheck(SystemTimingCheck<'a>),
|
||||
pub enum SpecifyItem {
|
||||
SpecparamDeclaration(SpecparamDeclaration),
|
||||
PulsestyleDeclaration(PulsestyleDeclaration),
|
||||
ShowcancelledDeclaration(ShowcancelledDeclaration),
|
||||
PathDeclaration(PathDeclaration),
|
||||
SystemTimingCheck(SystemTimingCheck),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PulsestyleDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>),
|
||||
pub struct PulsestyleDeclaration {
|
||||
pub nodes: (Keyword, ListOfPathOutputs, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ShowcancelledDeclaration<'a> {
|
||||
pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>),
|
||||
pub struct ShowcancelledDeclaration {
|
||||
pub nodes: (Keyword, ListOfPathOutputs, Symbol),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,43 +7,37 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecifyInputTerminalDescriptor<'a> {
|
||||
pub nodes: (
|
||||
InputIdentifier<'a>,
|
||||
Option<Bracket<'a, ConstantRangeExpression<'a>>>,
|
||||
),
|
||||
pub struct SpecifyInputTerminalDescriptor {
|
||||
pub nodes: (InputIdentifier, Option<Bracket<ConstantRangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SpecifyOutputTerminalDescriptor<'a> {
|
||||
pub nodes: (
|
||||
OutputIdentifier<'a>,
|
||||
Option<Bracket<'a, ConstantRangeExpression<'a>>>,
|
||||
),
|
||||
pub struct SpecifyOutputTerminalDescriptor {
|
||||
pub nodes: (OutputIdentifier, Option<Bracket<ConstantRangeExpression>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum InputIdentifier<'a> {
|
||||
InputPortIdentifier(InputPortIdentifier<'a>),
|
||||
InoutPortIdentifier(InoutPortIdentifier<'a>),
|
||||
Interface(InputIdentifierInterface<'a>),
|
||||
pub enum InputIdentifier {
|
||||
InputPortIdentifier(InputPortIdentifier),
|
||||
InoutPortIdentifier(InoutPortIdentifier),
|
||||
Interface(InputIdentifierInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InputIdentifierInterface<'a> {
|
||||
pub nodes: (InterfaceIdentifier<'a>, Symbol<'a>, PortIdentifier<'a>),
|
||||
pub struct InputIdentifierInterface {
|
||||
pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum OutputIdentifier<'a> {
|
||||
OutputPortIdentifier(OutputPortIdentifier<'a>),
|
||||
InoutPortIdentifier(InoutPortIdentifier<'a>),
|
||||
Interface(OutputIdentifierInterface<'a>),
|
||||
pub enum OutputIdentifier {
|
||||
OutputPortIdentifier(OutputPortIdentifier),
|
||||
InoutPortIdentifier(InoutPortIdentifier),
|
||||
Interface(OutputIdentifierInterface),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputIdentifierInterface<'a> {
|
||||
pub nodes: (InterfaceIdentifier<'a>, Symbol<'a>, PortIdentifier<'a>),
|
||||
pub struct OutputIdentifierInterface {
|
||||
pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,66 +8,60 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PathDeclaration<'a> {
|
||||
SimplePathDeclaration((SimplePathDeclaration<'a>, Symbol<'a>)),
|
||||
EdgeSensitivePathDeclaration((EdgeSensitivePathDeclaration<'a>, Symbol<'a>)),
|
||||
StateDependentPathDeclaration((StateDependentPathDeclaration<'a>, Symbol<'a>)),
|
||||
pub enum PathDeclaration {
|
||||
SimplePathDeclaration((SimplePathDeclaration, Symbol)),
|
||||
EdgeSensitivePathDeclaration((EdgeSensitivePathDeclaration, Symbol)),
|
||||
StateDependentPathDeclaration((StateDependentPathDeclaration, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SimplePathDeclaration<'a> {
|
||||
Parallel(SimplePathDeclarationParallel<'a>),
|
||||
Full(SimplePathDeclarationFull<'a>),
|
||||
pub enum SimplePathDeclaration {
|
||||
Parallel(SimplePathDeclarationParallel),
|
||||
Full(SimplePathDeclarationFull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimplePathDeclarationParallel<'a> {
|
||||
pub nodes: (ParallelPathDescription<'a>, Symbol<'a>, PathDelayValue<'a>),
|
||||
pub struct SimplePathDeclarationParallel {
|
||||
pub nodes: (ParallelPathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SimplePathDeclarationFull<'a> {
|
||||
pub nodes: (FullPathDescription<'a>, Symbol<'a>, PathDelayValue<'a>),
|
||||
pub struct SimplePathDeclarationFull {
|
||||
pub nodes: (FullPathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParallelPathDescription<'a> {
|
||||
pub struct ParallelPathDescription {
|
||||
pub nodes: (
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
SpecifyInputTerminalDescriptor<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
SpecifyOutputTerminalDescriptor<'a>,
|
||||
),
|
||||
>,
|
||||
Paren<(
|
||||
SpecifyInputTerminalDescriptor,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
SpecifyOutputTerminalDescriptor,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FullPathDescription<'a> {
|
||||
pub struct FullPathDescription {
|
||||
pub nodes: (
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ListOfPathInputs<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
ListOfPathOutputs<'a>,
|
||||
),
|
||||
>,
|
||||
Paren<(
|
||||
ListOfPathInputs,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
ListOfPathOutputs,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPathInputs<'a> {
|
||||
pub nodes: (List<Symbol<'a>, SpecifyInputTerminalDescriptor<'a>>,),
|
||||
pub struct ListOfPathInputs {
|
||||
pub nodes: (List<Symbol, SpecifyInputTerminalDescriptor>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPathOutputs<'a> {
|
||||
pub nodes: (List<Symbol<'a>, SpecifyOutputTerminalDescriptor<'a>>,),
|
||||
pub struct ListOfPathOutputs {
|
||||
pub nodes: (List<Symbol, SpecifyOutputTerminalDescriptor>,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,147 +8,123 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum PathDelayValue<'a> {
|
||||
ListOfPathDelayExpressions(ListOfPathDelayExpressions<'a>),
|
||||
Paren(PathDelayValueParen<'a>),
|
||||
pub enum PathDelayValue {
|
||||
ListOfPathDelayExpressions(ListOfPathDelayExpressions),
|
||||
Paren(PathDelayValueParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PathDelayValueParen<'a> {
|
||||
pub nodes: (Paren<'a, ListOfPathDelayExpressions<'a>>,),
|
||||
pub struct PathDelayValueParen {
|
||||
pub nodes: (Paren<ListOfPathDelayExpressions>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ListOfPathDelayExpressions<'a> {
|
||||
pub nodes: (List<Symbol<'a>, TPathDelayExpression<'a>>,),
|
||||
pub struct ListOfPathDelayExpressions {
|
||||
pub nodes: (List<Symbol, TPathDelayExpression>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TPathDelayExpression<'a> {
|
||||
pub nodes: (PathDelayExpression<'a>,),
|
||||
pub struct TPathDelayExpression {
|
||||
pub nodes: (PathDelayExpression,),
|
||||
}
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PathDelayExpression<'a> {
|
||||
pub nodes: (ConstantMintypmaxExpression<'a>,),
|
||||
pub struct PathDelayExpression {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EdgeSensitivePathDeclaration<'a> {
|
||||
Parallel(EdgeSensitivePathDeclarationParallel<'a>),
|
||||
Full(EdgeSensitivePathDeclarationFull<'a>),
|
||||
pub enum EdgeSensitivePathDeclaration {
|
||||
Parallel(EdgeSensitivePathDeclarationParallel),
|
||||
Full(EdgeSensitivePathDeclarationFull),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeSensitivePathDeclarationParallel<'a> {
|
||||
pub struct EdgeSensitivePathDeclarationParallel {
|
||||
pub nodes: (ParallelEdgeSensitivePathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeSensitivePathDeclarationFull {
|
||||
pub nodes: (FullEdgeSensitivePathDescription, Symbol, PathDelayValue),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParallelEdgeSensitivePathDescription {
|
||||
pub nodes: (
|
||||
ParallelEdgeSensitivePathDescription<'a>,
|
||||
Symbol<'a>,
|
||||
PathDelayValue<'a>,
|
||||
Paren<(
|
||||
Option<EdgeIdentifier>,
|
||||
SpecifyInputTerminalDescriptor,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
Paren<(
|
||||
SpecifyOutputTerminalDescriptor,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
DataSourceExpression,
|
||||
)>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeSensitivePathDeclarationFull<'a> {
|
||||
pub struct FullEdgeSensitivePathDescription {
|
||||
pub nodes: (
|
||||
FullEdgeSensitivePathDescription<'a>,
|
||||
Symbol<'a>,
|
||||
PathDelayValue<'a>,
|
||||
Paren<(
|
||||
Option<EdgeIdentifier>,
|
||||
ListOfPathInputs,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
Paren<(
|
||||
ListOfPathOutputs,
|
||||
Option<PolarityOperator>,
|
||||
Symbol,
|
||||
DataSourceExpression,
|
||||
)>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ParallelEdgeSensitivePathDescription<'a> {
|
||||
pub struct DataSourceExpression {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EdgeIdentifier {
|
||||
Posedge(Keyword),
|
||||
Negedge(Keyword),
|
||||
Edge(Keyword),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StateDependentPathDeclaration {
|
||||
IfSimple(StateDependentPathDeclarationIfSimple),
|
||||
IfEdgeSensitive(StateDependentPathDeclarationIfEdgeSensitive),
|
||||
IfNone(StateDependentPathDeclarationIfNone),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfSimple {
|
||||
pub nodes: (Keyword, Paren<ModulePathExpression>, SimplePathDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfEdgeSensitive {
|
||||
pub nodes: (
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
Option<EdgeIdentifier<'a>>,
|
||||
SpecifyInputTerminalDescriptor<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
SpecifyOutputTerminalDescriptor<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
DataSourceExpression<'a>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
>,
|
||||
Keyword,
|
||||
Paren<ModulePathExpression>,
|
||||
EdgeSensitivePathDeclaration,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FullEdgeSensitivePathDescription<'a> {
|
||||
pub nodes: (
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
Option<EdgeIdentifier<'a>>,
|
||||
ListOfPathInputs<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ListOfPathOutputs<'a>,
|
||||
Option<PolarityOperator<'a>>,
|
||||
Symbol<'a>,
|
||||
DataSourceExpression<'a>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
>,
|
||||
),
|
||||
pub struct StateDependentPathDeclarationIfNone {
|
||||
pub nodes: (Keyword, SimplePathDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataSourceExpression<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EdgeIdentifier<'a> {
|
||||
Posedge(Keyword<'a>),
|
||||
Negedge(Keyword<'a>),
|
||||
Edge(Keyword<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum StateDependentPathDeclaration<'a> {
|
||||
IfSimple(StateDependentPathDeclarationIfSimple<'a>),
|
||||
IfEdgeSensitive(StateDependentPathDeclarationIfEdgeSensitive<'a>),
|
||||
IfNone(StateDependentPathDeclarationIfNone<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfSimple<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, ModulePathExpression<'a>>,
|
||||
SimplePathDeclaration<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfEdgeSensitive<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<'a, ModulePathExpression<'a>>,
|
||||
EdgeSensitivePathDeclaration<'a>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StateDependentPathDeclarationIfNone<'a> {
|
||||
pub nodes: (Keyword<'a>, SimplePathDeclaration<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PolarityOperator<'a> {
|
||||
pub nodes: (Symbol<'a>,),
|
||||
pub struct PolarityOperator {
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -7,91 +7,85 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimecheckCondition<'a> {
|
||||
pub nodes: (MintypmaxExpression<'a>,),
|
||||
pub struct TimecheckCondition {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ControlledReferenceEvent<'a> {
|
||||
pub nodes: (ControlledTimingCheckEvent<'a>,),
|
||||
pub struct ControlledReferenceEvent {
|
||||
pub nodes: (ControlledTimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DataEvent<'a> {
|
||||
pub nodes: (TimingCheckEvent<'a>,),
|
||||
pub struct DataEvent {
|
||||
pub nodes: (TimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DelayedData<'a> {
|
||||
TerminalIdentifier(TerminalIdentifier<'a>),
|
||||
WithMintypmax(DelayedDataWithMintypmax<'a>),
|
||||
pub enum DelayedData {
|
||||
TerminalIdentifier(TerminalIdentifier),
|
||||
WithMintypmax(DelayedDataWithMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DelayedDataWithMintypmax<'a> {
|
||||
pub nodes: (
|
||||
TerminalIdentifier<'a>,
|
||||
Bracket<'a, ConstantMintypmaxExpression<'a>>,
|
||||
),
|
||||
pub struct DelayedDataWithMintypmax {
|
||||
pub nodes: (TerminalIdentifier, Bracket<ConstantMintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum DelayedReference<'a> {
|
||||
TerminalIdentifier(TerminalIdentifier<'a>),
|
||||
WithMintypmax(DelayedReferenceWithMintypmax<'a>),
|
||||
pub enum DelayedReference {
|
||||
TerminalIdentifier(TerminalIdentifier),
|
||||
WithMintypmax(DelayedReferenceWithMintypmax),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct DelayedReferenceWithMintypmax<'a> {
|
||||
pub nodes: (
|
||||
TerminalIdentifier<'a>,
|
||||
Bracket<'a, ConstantMintypmaxExpression<'a>>,
|
||||
),
|
||||
pub struct DelayedReferenceWithMintypmax {
|
||||
pub nodes: (TerminalIdentifier, Bracket<ConstantMintypmaxExpression>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EndEdgeOffset<'a> {
|
||||
pub nodes: (MintypmaxExpression<'a>,),
|
||||
pub struct EndEdgeOffset {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EventBasedFlag<'a> {
|
||||
pub nodes: (ConstantExpression<'a>,),
|
||||
pub struct EventBasedFlag {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Notifier<'a> {
|
||||
pub nodes: (VariableIdentifier<'a>,),
|
||||
pub struct Notifier {
|
||||
pub nodes: (VariableIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ReferenceEvent<'a> {
|
||||
pub nodes: (TimingCheckEvent<'a>,),
|
||||
pub struct ReferenceEvent {
|
||||
pub nodes: (TimingCheckEvent,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RemainActiveFlag<'a> {
|
||||
pub nodes: (ConstantMintypmaxExpression<'a>,),
|
||||
pub struct RemainActiveFlag {
|
||||
pub nodes: (ConstantMintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimestampCondition<'a> {
|
||||
pub nodes: (MintypmaxExpression<'a>,),
|
||||
pub struct TimestampCondition {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct StartEdgeOffset<'a> {
|
||||
pub nodes: (MintypmaxExpression<'a>,),
|
||||
pub struct StartEdgeOffset {
|
||||
pub nodes: (MintypmaxExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Threshold<'a> {
|
||||
pub nodes: (ConstantExpression<'a>,),
|
||||
pub struct Threshold {
|
||||
pub nodes: (ConstantExpression,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimingCheckLimit<'a> {
|
||||
pub nodes: (Expression<'a>,),
|
||||
pub struct TimingCheckLimit {
|
||||
pub nodes: (Expression,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -8,300 +8,264 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SystemTimingCheck<'a> {
|
||||
SetupTimingCheck(SetupTimingCheck<'a>),
|
||||
HoldTimingCheck(HoldTimingCheck<'a>),
|
||||
SetupholdTimingCheck(SetupholdTimingCheck<'a>),
|
||||
RecoveryTimingCheck(RecoveryTimingCheck<'a>),
|
||||
RemovalTimingCheck(RemovalTimingCheck<'a>),
|
||||
RecremTimingCheck(RecremTimingCheck<'a>),
|
||||
SkewTimingCheck(SkewTimingCheck<'a>),
|
||||
TimeskewTimingCheck(TimeskewTimingCheck<'a>),
|
||||
FullskewTimingCheck(FullskewTimingCheck<'a>),
|
||||
PeriodTimingCheck(PeriodTimingCheck<'a>),
|
||||
WidthTimingCheck(WidthTimingCheck<'a>),
|
||||
NochargeTimingCheck(NochargeTimingCheck<'a>),
|
||||
pub enum SystemTimingCheck {
|
||||
SetupTimingCheck(SetupTimingCheck),
|
||||
HoldTimingCheck(HoldTimingCheck),
|
||||
SetupholdTimingCheck(SetupholdTimingCheck),
|
||||
RecoveryTimingCheck(RecoveryTimingCheck),
|
||||
RemovalTimingCheck(RemovalTimingCheck),
|
||||
RecremTimingCheck(RecremTimingCheck),
|
||||
SkewTimingCheck(SkewTimingCheck),
|
||||
TimeskewTimingCheck(TimeskewTimingCheck),
|
||||
FullskewTimingCheck(FullskewTimingCheck),
|
||||
PeriodTimingCheck(PeriodTimingCheck),
|
||||
WidthTimingCheck(WidthTimingCheck),
|
||||
NochargeTimingCheck(NochargeTimingCheck),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SetupTimingCheck<'a> {
|
||||
pub struct SetupTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
DataEvent,
|
||||
Symbol,
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct HoldTimingCheck<'a> {
|
||||
pub struct HoldTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SetupholdTimingCheck<'a> {
|
||||
pub struct SetupholdTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(
|
||||
Symbol,
|
||||
Option<Notifier>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<Notifier<'a>>,
|
||||
Symbol,
|
||||
Option<TimestampCondition>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<TimestampCondition<'a>>,
|
||||
Symbol,
|
||||
Option<TimecheckCondition>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<TimecheckCondition<'a>>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<DelayedReference<'a>>,
|
||||
Option<(Symbol<'a>, Option<DelayedData<'a>>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
Option<DelayedReference>,
|
||||
Option<(Symbol, Option<DelayedData>)>,
|
||||
)>,
|
||||
)>,
|
||||
)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RecoveryTimingCheck<'a> {
|
||||
pub struct RecoveryTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RemovalTimingCheck<'a> {
|
||||
pub struct RemovalTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct RecremTimingCheck<'a> {
|
||||
pub struct RecremTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(
|
||||
Symbol,
|
||||
Option<Notifier>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<Notifier<'a>>,
|
||||
Symbol,
|
||||
Option<TimestampCondition>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<TimestampCondition<'a>>,
|
||||
Symbol,
|
||||
Option<TimecheckCondition>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<TimecheckCondition<'a>>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<DelayedReference<'a>>,
|
||||
Option<(Symbol<'a>, Option<DelayedData<'a>>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
Option<DelayedReference>,
|
||||
Option<(Symbol, Option<DelayedData>)>,
|
||||
)>,
|
||||
)>,
|
||||
)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SkewTimingCheck<'a> {
|
||||
pub struct SkewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimeskewTimingCheck<'a> {
|
||||
pub struct TimeskewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(
|
||||
Symbol,
|
||||
Option<Notifier>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<Notifier<'a>>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<EventBasedFlag<'a>>,
|
||||
Option<(Symbol<'a>, Option<RemainActiveFlag<'a>>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
Option<EventBasedFlag>,
|
||||
Option<(Symbol, Option<RemainActiveFlag>)>,
|
||||
)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct FullskewTimingCheck<'a> {
|
||||
pub struct FullskewTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(
|
||||
Symbol,
|
||||
Option<Notifier>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<Notifier<'a>>,
|
||||
Option<(
|
||||
Symbol<'a>,
|
||||
Option<EventBasedFlag<'a>>,
|
||||
Option<(Symbol<'a>, Option<RemainActiveFlag<'a>>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
Option<EventBasedFlag>,
|
||||
Option<(Symbol, Option<RemainActiveFlag>)>,
|
||||
)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct PeriodTimingCheck<'a> {
|
||||
pub struct PeriodTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ControlledReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ControlledReferenceEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct WidthTimingCheck<'a> {
|
||||
pub struct WidthTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ControlledReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
TimingCheckLimit<'a>,
|
||||
Symbol<'a>,
|
||||
Threshold<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ControlledReferenceEvent,
|
||||
Symbol,
|
||||
TimingCheckLimit,
|
||||
Symbol,
|
||||
Threshold,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct NochargeTimingCheck<'a> {
|
||||
pub struct NochargeTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
ReferenceEvent<'a>,
|
||||
Symbol<'a>,
|
||||
DataEvent<'a>,
|
||||
Symbol<'a>,
|
||||
StartEdgeOffset<'a>,
|
||||
Symbol<'a>,
|
||||
EndEdgeOffset<'a>,
|
||||
Option<(Symbol<'a>, Option<Notifier<'a>>)>,
|
||||
),
|
||||
>,
|
||||
Symbol<'a>,
|
||||
Keyword,
|
||||
Paren<(
|
||||
ReferenceEvent,
|
||||
Symbol,
|
||||
DataEvent,
|
||||
Symbol,
|
||||
StartEdgeOffset,
|
||||
Symbol,
|
||||
EndEdgeOffset,
|
||||
Option<(Symbol, Option<Notifier>)>,
|
||||
)>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -8,81 +8,78 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimingCheckEvent<'a> {
|
||||
pub struct TimingCheckEvent {
|
||||
pub nodes: (
|
||||
Option<TimingCheckEventControl<'a>>,
|
||||
SpecifyTerminalDescriptor<'a>,
|
||||
Option<(Symbol<'a>, TimingCheckCondition<'a>)>,
|
||||
Option<TimingCheckEventControl>,
|
||||
SpecifyTerminalDescriptor,
|
||||
Option<(Symbol, TimingCheckCondition)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ControlledTimingCheckEvent<'a> {
|
||||
pub struct ControlledTimingCheckEvent {
|
||||
pub nodes: (
|
||||
TimingCheckEventControl<'a>,
|
||||
SpecifyTerminalDescriptor<'a>,
|
||||
Option<(Symbol<'a>, TimingCheckCondition<'a>)>,
|
||||
TimingCheckEventControl,
|
||||
SpecifyTerminalDescriptor,
|
||||
Option<(Symbol, TimingCheckCondition)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TimingCheckEventControl<'a> {
|
||||
Posedge(Keyword<'a>),
|
||||
Negedge(Keyword<'a>),
|
||||
Edge(Keyword<'a>),
|
||||
EdgeControlSpecifier(EdgeControlSpecifier<'a>),
|
||||
pub enum TimingCheckEventControl {
|
||||
Posedge(Keyword),
|
||||
Negedge(Keyword),
|
||||
Edge(Keyword),
|
||||
EdgeControlSpecifier(EdgeControlSpecifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SpecifyTerminalDescriptor<'a> {
|
||||
SpecifyInputTerminalDescriptor(SpecifyInputTerminalDescriptor<'a>),
|
||||
SpecifyOutputTerminalDescriptor(SpecifyOutputTerminalDescriptor<'a>),
|
||||
pub enum SpecifyTerminalDescriptor {
|
||||
SpecifyInputTerminalDescriptor(SpecifyInputTerminalDescriptor),
|
||||
SpecifyOutputTerminalDescriptor(SpecifyOutputTerminalDescriptor),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeControlSpecifier<'a> {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
Bracket<'a, List<Symbol<'a>, EdgeDescriptor<'a>>>,
|
||||
),
|
||||
pub struct EdgeControlSpecifier {
|
||||
pub nodes: (Keyword, Bracket<List<Symbol, EdgeDescriptor>>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeDescriptor<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct EdgeDescriptor {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum TimingCheckCondition<'a> {
|
||||
ScalarTimingCheckCondition(ScalarTimingCheckCondition<'a>),
|
||||
Paren(TimingCheckConditionParen<'a>),
|
||||
pub enum TimingCheckCondition {
|
||||
ScalarTimingCheckCondition(ScalarTimingCheckCondition),
|
||||
Paren(TimingCheckConditionParen),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct TimingCheckConditionParen<'a> {
|
||||
pub nodes: (Paren<'a, ScalarTimingCheckCondition<'a>>,),
|
||||
pub struct TimingCheckConditionParen {
|
||||
pub nodes: (Paren<ScalarTimingCheckCondition>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum ScalarTimingCheckCondition<'a> {
|
||||
Expression(Expression<'a>),
|
||||
Unary(ScalarTimingCheckConditionUnary<'a>),
|
||||
Binary(ScalarTimingCheckConditionBinary<'a>),
|
||||
pub enum ScalarTimingCheckCondition {
|
||||
Expression(Expression),
|
||||
Unary(ScalarTimingCheckConditionUnary),
|
||||
Binary(ScalarTimingCheckConditionBinary),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ScalarTimingCheckConditionUnary<'a> {
|
||||
pub nodes: (Symbol<'a>, Expression<'a>),
|
||||
pub struct ScalarTimingCheckConditionUnary {
|
||||
pub nodes: (Symbol, Expression),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ScalarTimingCheckConditionBinary<'a> {
|
||||
pub nodes: (Expression<'a>, Symbol<'a>, ScalarConstant<'a>),
|
||||
pub struct ScalarTimingCheckConditionBinary {
|
||||
pub nodes: (Expression, Symbol, ScalarConstant),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct ScalarConstant<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct ScalarConstant {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,120 +9,110 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UdpBody<'a> {
|
||||
CombinationalBody(CombinationalBody<'a>),
|
||||
SequentialBody(SequentialBody<'a>),
|
||||
pub enum UdpBody {
|
||||
CombinationalBody(CombinationalBody),
|
||||
SequentialBody(SequentialBody),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CombinationalBody<'a> {
|
||||
pub struct CombinationalBody {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
CombinationalEntry<'a>,
|
||||
Vec<CombinationalEntry<'a>>,
|
||||
Keyword<'a>,
|
||||
Keyword,
|
||||
CombinationalEntry,
|
||||
Vec<CombinationalEntry>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CombinationalEntry<'a> {
|
||||
pub nodes: (LevelInputList<'a>, Symbol<'a>, OutputSymbol<'a>, Symbol<'a>),
|
||||
pub struct CombinationalEntry {
|
||||
pub nodes: (LevelInputList, Symbol, OutputSymbol, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SequentialBody<'a> {
|
||||
pub struct SequentialBody {
|
||||
pub nodes: (
|
||||
Option<UdpInitialStatement<'a>>,
|
||||
Keyword<'a>,
|
||||
SequentialEntry<'a>,
|
||||
Vec<SequentialEntry<'a>>,
|
||||
Keyword<'a>,
|
||||
Option<UdpInitialStatement>,
|
||||
Keyword,
|
||||
SequentialEntry,
|
||||
Vec<SequentialEntry>,
|
||||
Keyword,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpInitialStatement<'a> {
|
||||
pub struct UdpInitialStatement {
|
||||
pub nodes: (Keyword, OutputPortIdentifier, Symbol, InitVal, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InitVal {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SequentialEntry {
|
||||
pub nodes: (
|
||||
Keyword<'a>,
|
||||
OutputPortIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
InitVal<'a>,
|
||||
Symbol<'a>,
|
||||
SeqInputList,
|
||||
Symbol,
|
||||
CurrentState,
|
||||
Symbol,
|
||||
NextState,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct InitVal<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub enum SeqInputList {
|
||||
LevelInputList(LevelInputList),
|
||||
EdgeInputList(EdgeInputList),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct SequentialEntry<'a> {
|
||||
pub nodes: (
|
||||
SeqInputList<'a>,
|
||||
Symbol<'a>,
|
||||
CurrentState<'a>,
|
||||
Symbol<'a>,
|
||||
NextState<'a>,
|
||||
Symbol<'a>,
|
||||
),
|
||||
pub struct LevelInputList {
|
||||
pub nodes: (LevelSymbol, Vec<LevelSymbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum SeqInputList<'a> {
|
||||
LevelInputList(LevelInputList<'a>),
|
||||
EdgeInputList(EdgeInputList<'a>),
|
||||
pub struct EdgeInputList {
|
||||
pub nodes: (Vec<LevelSymbol>, EdgeIndicator, Vec<LevelSymbol>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LevelInputList<'a> {
|
||||
pub nodes: (LevelSymbol<'a>, Vec<LevelSymbol<'a>>),
|
||||
pub enum EdgeIndicator {
|
||||
Paren(EdgeIndicatorParen),
|
||||
EdgeSymbol(EdgeSymbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeInputList<'a> {
|
||||
pub nodes: (
|
||||
Vec<LevelSymbol<'a>>,
|
||||
EdgeIndicator<'a>,
|
||||
Vec<LevelSymbol<'a>>,
|
||||
),
|
||||
pub struct EdgeIndicatorParen {
|
||||
pub nodes: (Paren<(LevelSymbol, LevelSymbol)>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum EdgeIndicator<'a> {
|
||||
Paren(EdgeIndicatorParen<'a>),
|
||||
EdgeSymbol(EdgeSymbol<'a>),
|
||||
pub struct CurrentState {
|
||||
pub nodes: (LevelSymbol,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeIndicatorParen<'a> {
|
||||
pub nodes: (Paren<'a, (LevelSymbol<'a>, LevelSymbol<'a>)>,),
|
||||
pub enum NextState {
|
||||
OutputSymbol(OutputSymbol),
|
||||
Minus(Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct CurrentState<'a> {
|
||||
pub nodes: (LevelSymbol<'a>,),
|
||||
pub struct OutputSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum NextState<'a> {
|
||||
OutputSymbol(OutputSymbol<'a>),
|
||||
Minus(Symbol<'a>),
|
||||
pub struct LevelSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct OutputSymbol<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct LevelSymbol<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct EdgeSymbol<'a> {
|
||||
pub nodes: (Keyword<'a>,),
|
||||
pub struct EdgeSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -9,80 +9,80 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpNonansiDeclaration<'a> {
|
||||
pub struct UdpNonansiDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
UdpIdentifier<'a>,
|
||||
Paren<'a, UdpPortList<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
UdpIdentifier,
|
||||
Paren<UdpPortList>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpAnsiDeclaration<'a> {
|
||||
pub struct UdpAnsiDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
UdpIdentifier<'a>,
|
||||
Paren<'a, UdpDeclarationPortList<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
UdpIdentifier,
|
||||
Paren<UdpDeclarationPortList>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UdpDeclaration<'a> {
|
||||
Nonansi(UdpDeclarationNonansi<'a>),
|
||||
Ansi(UdpDeclarationAnsi<'a>),
|
||||
ExternNonansi(UdpDeclarationExternNonansi<'a>),
|
||||
ExternAnsi(UdpDeclarationExternAnsi<'a>),
|
||||
Wildcard(UdpDeclarationWildcard<'a>),
|
||||
pub enum UdpDeclaration {
|
||||
Nonansi(UdpDeclarationNonansi),
|
||||
Ansi(UdpDeclarationAnsi),
|
||||
ExternNonansi(UdpDeclarationExternNonansi),
|
||||
ExternAnsi(UdpDeclarationExternAnsi),
|
||||
Wildcard(UdpDeclarationWildcard),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationNonansi<'a> {
|
||||
pub struct UdpDeclarationNonansi {
|
||||
pub nodes: (
|
||||
UdpNonansiDeclaration<'a>,
|
||||
UdpPortDeclaration<'a>,
|
||||
Vec<UdpPortDeclaration<'a>>,
|
||||
UdpBody<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, UdpIdentifier<'a>)>,
|
||||
UdpNonansiDeclaration,
|
||||
UdpPortDeclaration,
|
||||
Vec<UdpPortDeclaration>,
|
||||
UdpBody,
|
||||
Keyword,
|
||||
Option<(Symbol, UdpIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationAnsi<'a> {
|
||||
pub struct UdpDeclarationAnsi {
|
||||
pub nodes: (
|
||||
UdpAnsiDeclaration<'a>,
|
||||
UdpBody<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, UdpIdentifier<'a>)>,
|
||||
UdpAnsiDeclaration,
|
||||
UdpBody,
|
||||
Keyword,
|
||||
Option<(Symbol, UdpIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationExternNonansi<'a> {
|
||||
pub nodes: (Keyword<'a>, UdpNonansiDeclaration<'a>),
|
||||
pub struct UdpDeclarationExternNonansi {
|
||||
pub nodes: (Keyword, UdpNonansiDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationExternAnsi<'a> {
|
||||
pub nodes: (Keyword<'a>, UdpAnsiDeclaration<'a>),
|
||||
pub struct UdpDeclarationExternAnsi {
|
||||
pub nodes: (Keyword, UdpAnsiDeclaration),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationWildcard<'a> {
|
||||
pub struct UdpDeclarationWildcard {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
UdpIdentifier<'a>,
|
||||
Paren<'a, Symbol<'a>>,
|
||||
Symbol<'a>,
|
||||
Vec<UdpPortDeclaration<'a>>,
|
||||
UdpBody<'a>,
|
||||
Keyword<'a>,
|
||||
Option<(Symbol<'a>, UdpIdentifier<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
UdpIdentifier,
|
||||
Paren<Symbol>,
|
||||
Symbol,
|
||||
Vec<UdpPortDeclaration>,
|
||||
UdpBody,
|
||||
Keyword,
|
||||
Option<(Symbol, UdpIdentifier)>,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -8,29 +8,26 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpInstantiation<'a> {
|
||||
pub struct UdpInstantiation {
|
||||
pub nodes: (
|
||||
UdpIdentifier<'a>,
|
||||
Option<DriveStrength<'a>>,
|
||||
Option<Delay2<'a>>,
|
||||
List<Symbol<'a>, UdpInstance<'a>>,
|
||||
Symbol<'a>,
|
||||
UdpIdentifier,
|
||||
Option<DriveStrength>,
|
||||
Option<Delay2>,
|
||||
List<Symbol, UdpInstance>,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpInstance<'a> {
|
||||
pub struct UdpInstance {
|
||||
pub nodes: (
|
||||
Option<NameOfInstance<'a>>,
|
||||
Paren<
|
||||
'a,
|
||||
(
|
||||
OutputTerminal<'a>,
|
||||
Symbol<'a>,
|
||||
InputTerminal<'a>,
|
||||
Vec<(Symbol<'a>, InputTerminal<'a>)>,
|
||||
),
|
||||
>,
|
||||
Option<NameOfInstance>,
|
||||
Paren<(
|
||||
OutputTerminal,
|
||||
Symbol,
|
||||
InputTerminal,
|
||||
Vec<(Symbol, InputTerminal)>,
|
||||
)>,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -9,67 +9,67 @@ use nom::IResult;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpPortList<'a> {
|
||||
pub struct UdpPortList {
|
||||
pub nodes: (
|
||||
OutputPortIdentifier<'a>,
|
||||
Symbol<'a>,
|
||||
List<Symbol<'a>, InputPortIdentifier<'a>>,
|
||||
OutputPortIdentifier,
|
||||
Symbol,
|
||||
List<Symbol, InputPortIdentifier>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpDeclarationPortList<'a> {
|
||||
pub struct UdpDeclarationPortList {
|
||||
pub nodes: (
|
||||
UdpOutputDeclaration<'a>,
|
||||
Symbol<'a>,
|
||||
List<Symbol<'a>, UdpInputDeclaration<'a>>,
|
||||
UdpOutputDeclaration,
|
||||
Symbol,
|
||||
List<Symbol, UdpInputDeclaration>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UdpPortDeclaration<'a> {
|
||||
UdpOutputDeclaration((UdpOutputDeclaration<'a>, Symbol<'a>)),
|
||||
UdpInputDeclaration((UdpInputDeclaration<'a>, Symbol<'a>)),
|
||||
UdpRegDeclaration((UdpRegDeclaration<'a>, Symbol<'a>)),
|
||||
pub enum UdpPortDeclaration {
|
||||
UdpOutputDeclaration((UdpOutputDeclaration, Symbol)),
|
||||
UdpInputDeclaration((UdpInputDeclaration, Symbol)),
|
||||
UdpRegDeclaration((UdpRegDeclaration, Symbol)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum UdpOutputDeclaration<'a> {
|
||||
Nonreg(UdpOutputDeclarationNonreg<'a>),
|
||||
Reg(UdpOutputDeclarationReg<'a>),
|
||||
pub enum UdpOutputDeclaration {
|
||||
Nonreg(UdpOutputDeclarationNonreg),
|
||||
Reg(UdpOutputDeclarationReg),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpOutputDeclarationNonreg<'a> {
|
||||
pub nodes: (Vec<AttributeInstance<'a>>, Keyword<'a>, PortIdentifier<'a>),
|
||||
pub struct UdpOutputDeclarationNonreg {
|
||||
pub nodes: (Vec<AttributeInstance>, Keyword, PortIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpOutputDeclarationReg<'a> {
|
||||
pub struct UdpOutputDeclarationReg {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
Keyword<'a>,
|
||||
PortIdentifier<'a>,
|
||||
Option<(Symbol<'a>, ConstantExpression<'a>)>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
Keyword,
|
||||
PortIdentifier,
|
||||
Option<(Symbol, ConstantExpression)>,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpInputDeclaration<'a> {
|
||||
pub struct UdpInputDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
ListOfUdpPortIdentifiers<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
ListOfUdpPortIdentifiers,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct UdpRegDeclaration<'a> {
|
||||
pub struct UdpRegDeclaration {
|
||||
pub nodes: (
|
||||
Vec<AttributeInstance<'a>>,
|
||||
Keyword<'a>,
|
||||
VariableIdentifier<'a>,
|
||||
Vec<AttributeInstance>,
|
||||
Keyword,
|
||||
VariableIdentifier,
|
||||
),
|
||||
}
|
||||
|
||||
|
@ -262,39 +262,39 @@ const KEYWORDS: &[&str] = &[
|
||||
];
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Symbol<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct Symbol {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub struct Keyword<'a> {
|
||||
pub nodes: (Span<'a>, Vec<WhiteSpace<'a>>),
|
||||
pub struct Keyword {
|
||||
pub nodes: (Locate, Vec<WhiteSpace>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Node)]
|
||||
pub enum WhiteSpace<'a> {
|
||||
Space(Span<'a>),
|
||||
Comment(Comment<'a>),
|
||||
pub enum WhiteSpace {
|
||||
Space(Locate),
|
||||
Comment(Comment),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Paren<'a, T: 'a> {
|
||||
pub nodes: (Symbol<'a>, T, Symbol<'a>),
|
||||
pub struct Paren<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Brace<'a, T: 'a> {
|
||||
pub nodes: (Symbol<'a>, T, Symbol<'a>),
|
||||
pub struct Brace<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Bracket<'a, T: 'a> {
|
||||
pub nodes: (Symbol<'a>, T, Symbol<'a>),
|
||||
pub struct Bracket<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ApostropheBrace<'a, T: 'a> {
|
||||
pub nodes: (Symbol<'a>, T, Symbol<'a>),
|
||||
pub struct ApostropheBrace<T> {
|
||||
pub nodes: (Symbol, T, Symbol),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -304,7 +304,7 @@ pub struct List<T, U> {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
pub fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, (O, Vec<WhiteSpace<'a>>)>
|
||||
pub fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, (O, Vec<WhiteSpace>)>
|
||||
where
|
||||
F: Fn(Span<'a>) -> IResult<Span<'a>, O>,
|
||||
{
|
||||
@ -315,22 +315,28 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Symbol<'a>> {
|
||||
pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Symbol> {
|
||||
move |s: Span<'a>| {
|
||||
#[cfg(feature = "trace")]
|
||||
let s = trace(s, &format!("symbol(\"{}\")", t));
|
||||
let (s, x) = map(ws(tag(t.clone())), |x| Symbol { nodes: x })(s)?;
|
||||
let (s, x) = map(ws(map(tag(t.clone()), |x: Span| x.into())), |x| Symbol {
|
||||
nodes: x,
|
||||
})(s)?;
|
||||
Ok((clear_recursive_flags(s), x))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Keyword<'a>> {
|
||||
pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Keyword> {
|
||||
move |s: Span<'a>| {
|
||||
#[cfg(feature = "trace")]
|
||||
let s = trace(s, &format!("keyword(\"{}\")", t));
|
||||
let (s, x) = map(ws(terminated(tag(t.clone()), peek(none_of(AZ09_)))), |x| {
|
||||
Keyword { nodes: x }
|
||||
})(s)?;
|
||||
let (s, x) = map(
|
||||
ws(terminated(
|
||||
map(tag(t.clone()), |x: Span| x.into()),
|
||||
peek(none_of(AZ09_)),
|
||||
)),
|
||||
|x| Keyword { nodes: x },
|
||||
)(s)?;
|
||||
Ok((clear_recursive_flags(s), x))
|
||||
}
|
||||
}
|
||||
@ -467,7 +473,7 @@ where
|
||||
#[parser]
|
||||
pub fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
|
||||
alt((
|
||||
map(multispace1, |x| WhiteSpace::Space(x)),
|
||||
map(multispace1, |x: Span| WhiteSpace::Space(x.into())),
|
||||
map(comment, |x| WhiteSpace::Comment(x)),
|
||||
))(s)
|
||||
}
|
||||
|
@ -52,24 +52,24 @@ fn impl_node(ast: &DeriveInput) -> TokenStream {
|
||||
};
|
||||
|
||||
let gen = quote! {
|
||||
impl<'a> Node<'a> for #name<'a> {
|
||||
impl<'a> Node<'a> for #name {
|
||||
fn next(&'a self) -> AnyNodes<'a> {
|
||||
#next
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a #name<'a>> for AnyNodes<'a> {
|
||||
fn from(x: &'a #name<'a>) -> Self {
|
||||
impl<'a> From<&'a #name> for AnyNodes<'a> {
|
||||
fn from(x: &'a #name) -> Self {
|
||||
vec![AnyNode::#name(x)].into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a #name<'a> {
|
||||
impl<'a> IntoIterator for &'a #name {
|
||||
type Item = AnyNode<'a>;
|
||||
type IntoIter = Iter<'a>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
let nodes: AnyNodes<'a> = self.into();
|
||||
let nodes: AnyNodes = self.into();
|
||||
Iter { next: nodes }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user