Add test
This commit is contained in:
parent
46a5caadac
commit
0c58a10f36
16
README.md
16
README.md
@ -81,16 +81,16 @@ A parser library for System Verilog.
|
|||||||
|
|
||||||
| Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass |
|
| Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass |
|
||||||
| ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- |
|
| ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- |
|
||||||
| 3 | x | x | 13 | | | 23 | | | 33 | | |
|
| 3 | x | x | 13 | x | | 23 | | | 33 | | |
|
||||||
| 4 | x | x | 14 | | | 24 | | | 34 | | |
|
| 4 | x | x | 14 | x | | 24 | | | 34 | | |
|
||||||
| 5 | x | x | 15 | | | 25 | | | 35 | | |
|
| 5 | x | x | 15 | x | | 25 | | | 35 | | |
|
||||||
| 6 | x | | 16 | | | 26 | | | 36 | | |
|
| 6 | x | | 16 | x | | 26 | | | 36 | | |
|
||||||
| 7 | x | | 17 | | | 27 | | | 37 | | |
|
| 7 | x | | 17 | | | 27 | | | 37 | | |
|
||||||
| 8 | x | | 18 | | | 28 | | | 38 | | |
|
| 8 | x | | 18 | | | 28 | | | 38 | | |
|
||||||
| 9 | | | 19 | | | 29 | | | 39 | | |
|
| 9 | x | | 19 | | | 29 | | | 39 | | |
|
||||||
| 10 | | | 20 | | | 30 | | | 40 | | |
|
| 10 | x | | 20 | | | 30 | | | 40 | | |
|
||||||
| 11 | | | 21 | | | 31 | | | | | |
|
| 11 | x | | 21 | | | 31 | | | | | |
|
||||||
| 12 | | | 22 | | | 32 | | | | | |
|
| 12 | x | | 22 | | | 32 | | | | | |
|
||||||
|
|
||||||
## Missing entry of specification
|
## Missing entry of specification
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
|
pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
|
||||||
alt((
|
alt((
|
||||||
map(concurrent_assertion_item, |x| {
|
map(concurrent_assertion_item, |x| {
|
||||||
@ -15,6 +16,7 @@ pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn deferred_immediate_assertion_item(
|
pub(crate) fn deferred_immediate_assertion_item(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DeferredImmediateAssetionItem> {
|
) -> IResult<Span, DeferredImmediateAssetionItem> {
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn deferred_immediate_assertion_item(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_assertion_statement(
|
pub(crate) fn procedural_assertion_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralAssertionStatement> {
|
) -> IResult<Span, ProceduralAssertionStatement> {
|
||||||
@ -41,6 +44,7 @@ pub(crate) fn procedural_assertion_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetionStatement> {
|
pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetionStatement> {
|
||||||
alt((
|
alt((
|
||||||
map(simple_immediate_assertion_statement, |x| {
|
map(simple_immediate_assertion_statement, |x| {
|
||||||
@ -53,6 +57,7 @@ pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateA
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_immediate_assertion_statement(
|
pub(crate) fn simple_immediate_assertion_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SimpleImmediateAssertionStatement> {
|
) -> IResult<Span, SimpleImmediateAssertionStatement> {
|
||||||
@ -70,6 +75,7 @@ pub(crate) fn simple_immediate_assertion_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_immediate_assert_statement(
|
pub(crate) fn simple_immediate_assert_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SimpleImmediateAssertStatement> {
|
) -> IResult<Span, SimpleImmediateAssertStatement> {
|
||||||
@ -80,6 +86,7 @@ pub(crate) fn simple_immediate_assert_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_immediate_assume_statement(
|
pub(crate) fn simple_immediate_assume_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SimpleImmediateAssumeStatement> {
|
) -> IResult<Span, SimpleImmediateAssumeStatement> {
|
||||||
@ -90,6 +97,7 @@ pub(crate) fn simple_immediate_assume_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_immediate_cover_statement(
|
pub(crate) fn simple_immediate_cover_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SimpleImmediateCoverStatement> {
|
) -> IResult<Span, SimpleImmediateCoverStatement> {
|
||||||
@ -100,6 +108,7 @@ pub(crate) fn simple_immediate_cover_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn deferred_immediate_assertion_statement(
|
pub(crate) fn deferred_immediate_assertion_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DeferredImmediateAssertionStatement> {
|
) -> IResult<Span, DeferredImmediateAssertionStatement> {
|
||||||
@ -117,6 +126,7 @@ pub(crate) fn deferred_immediate_assertion_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn deferred_immediate_assert_statement(
|
pub(crate) fn deferred_immediate_assert_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DeferredImmediateAssertStatement> {
|
) -> IResult<Span, DeferredImmediateAssertStatement> {
|
||||||
@ -133,6 +143,7 @@ pub(crate) fn deferred_immediate_assert_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn deferred_immediate_assume_statement(
|
pub(crate) fn deferred_immediate_assume_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DeferredImmediateAssumeStatement> {
|
) -> IResult<Span, DeferredImmediateAssumeStatement> {
|
||||||
@ -149,6 +160,7 @@ pub(crate) fn deferred_immediate_assume_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn deferred_immediate_cover_statement(
|
pub(crate) fn deferred_immediate_cover_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DeferredImmediateCoverStatement> {
|
) -> IResult<Span, DeferredImmediateCoverStatement> {
|
||||||
@ -165,6 +177,7 @@ pub(crate) fn deferred_immediate_cover_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assert_timing(s: Span) -> IResult<Span, AssertTiming> {
|
pub(crate) fn assert_timing(s: Span) -> IResult<Span, AssertTiming> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("#0"), |x| AssertTiming::Zero(Box::new(x))),
|
map(symbol("#0"), |x| AssertTiming::Zero(Box::new(x))),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
|
pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
|
||||||
alt((
|
alt((
|
||||||
case_statement_normal,
|
case_statement_normal,
|
||||||
@ -12,6 +13,7 @@ pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
|
pub(crate) fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
|
||||||
let (s, a) = opt(unique_priority)(s)?;
|
let (s, a) = opt(unique_priority)(s)?;
|
||||||
let (s, b) = case_keyword(s)?;
|
let (s, b) = case_keyword(s)?;
|
||||||
@ -28,6 +30,7 @@ pub(crate) fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
|
pub(crate) fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
|
||||||
let (s, a) = opt(unique_priority)(s)?;
|
let (s, a) = opt(unique_priority)(s)?;
|
||||||
let (s, b) = case_keyword(s)?;
|
let (s, b) = case_keyword(s)?;
|
||||||
@ -45,6 +48,7 @@ pub(crate) fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
|
pub(crate) fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
|
||||||
let (s, a) = opt(unique_priority)(s)?;
|
let (s, a) = opt(unique_priority)(s)?;
|
||||||
let (s, b) = keyword("case")(s)?;
|
let (s, b) = keyword("case")(s)?;
|
||||||
@ -62,6 +66,7 @@ pub(crate) fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
|
pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("casez"), |x| CaseKeyword::Casez(Box::new(x))),
|
map(keyword("casez"), |x| CaseKeyword::Casez(Box::new(x))),
|
||||||
@ -71,12 +76,14 @@ pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_expression(s: Span) -> IResult<Span, CaseExpression> {
|
pub(crate) fn case_expression(s: Span) -> IResult<Span, CaseExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, CaseExpression { nodes: (a,) }))
|
Ok((s, CaseExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
|
pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
|
||||||
alt((
|
alt((
|
||||||
case_item_nondefault,
|
case_item_nondefault,
|
||||||
@ -86,6 +93,7 @@ pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
|
pub(crate) fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
|
||||||
let (s, a) = list(symbol(","), case_item_expression)(s)?;
|
let (s, a) = list(symbol(","), case_item_expression)(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -97,6 +105,7 @@ pub(crate) fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
|
pub(crate) fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
let (s, b) = opt(symbol(":"))(s)?;
|
let (s, b) = opt(symbol(":"))(s)?;
|
||||||
@ -105,6 +114,7 @@ pub(crate) fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
|
pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
|
||||||
alt((
|
alt((
|
||||||
case_pattern_item_nondefault,
|
case_pattern_item_nondefault,
|
||||||
@ -114,6 +124,7 @@ pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePatternItem> {
|
pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePatternItem> {
|
||||||
let (s, a) = pattern(s)?;
|
let (s, a) = pattern(s)?;
|
||||||
let (s, b) = opt(pair(symbol("&&&"), expression))(s)?;
|
let (s, b) = opt(pair(symbol("&&&"), expression))(s)?;
|
||||||
@ -128,6 +139,7 @@ pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePattern
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
|
pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
|
||||||
alt((
|
alt((
|
||||||
case_inside_item_nondefault,
|
case_inside_item_nondefault,
|
||||||
@ -137,6 +149,7 @@ pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
|
pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
|
||||||
let (s, a) = open_range_list(s)?;
|
let (s, a) = open_range_list(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -148,12 +161,14 @@ pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_item_expression(s: Span) -> IResult<Span, CaseItemExpression> {
|
pub(crate) fn case_item_expression(s: Span) -> IResult<Span, CaseItemExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, CaseItemExpression { nodes: (a,) }))
|
Ok((s, CaseItemExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
|
pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
|
||||||
let (s, a) = keyword("randcase")(s)?;
|
let (s, a) = keyword("randcase")(s)?;
|
||||||
let (s, b) = randcase_item(s)?;
|
let (s, b) = randcase_item(s)?;
|
||||||
@ -169,6 +184,7 @@ pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
|
pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -178,12 +194,14 @@ pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn open_range_list(s: Span) -> IResult<Span, OpenRangeList> {
|
pub(crate) fn open_range_list(s: Span) -> IResult<Span, OpenRangeList> {
|
||||||
let (s, a) = list(symbol(","), open_value_range)(s)?;
|
let (s, a) = list(symbol(","), open_value_range)(s)?;
|
||||||
Ok((s, OpenRangeList { nodes: (a,) }))
|
Ok((s, OpenRangeList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn open_value_range(s: Span) -> IResult<Span, OpenValueRange> {
|
pub(crate) fn open_value_range(s: Span) -> IResult<Span, OpenValueRange> {
|
||||||
let (s, a) = value_range(s)?;
|
let (s, a) = value_range(s)?;
|
||||||
Ok((s, OpenValueRange { nodes: (a,) }))
|
Ok((s, OpenValueRange { nodes: (a,) }))
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_declaration(s: Span) -> IResult<Span, ClockingDeclaration> {
|
pub(crate) fn clocking_declaration(s: Span) -> IResult<Span, ClockingDeclaration> {
|
||||||
alt((clocking_declaration_local, clocking_declaration_global))(s)
|
alt((clocking_declaration_local, clocking_declaration_global))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration> {
|
pub(crate) fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration> {
|
||||||
let (s, a) = opt(default)(s)?;
|
let (s, a) = opt(default)(s)?;
|
||||||
let (s, b) = keyword("clocking")(s)?;
|
let (s, b) = keyword("clocking")(s)?;
|
||||||
@ -26,12 +28,14 @@ pub(crate) fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDecla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default(s: Span) -> IResult<Span, Default> {
|
pub(crate) fn default(s: Span) -> IResult<Span, Default> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
Ok((s, Default { nodes: (a,) }))
|
Ok((s, Default { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration> {
|
pub(crate) fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration> {
|
||||||
let (s, a) = keyword("global")(s)?;
|
let (s, a) = keyword("global")(s)?;
|
||||||
let (s, b) = keyword("clocking")(s)?;
|
let (s, b) = keyword("clocking")(s)?;
|
||||||
@ -49,11 +53,13 @@ pub(crate) fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_event(s: Span) -> IResult<Span, ClockingEvent> {
|
pub(crate) fn clocking_event(s: Span) -> IResult<Span, ClockingEvent> {
|
||||||
alt((clocking_event_identifier, clocking_event_expression))(s)
|
alt((clocking_event_identifier, clocking_event_expression))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
|
pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = identifier(s)?;
|
let (s, b) = identifier(s)?;
|
||||||
@ -64,6 +70,7 @@ pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
|
pub(crate) fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = paren(event_expression)(s)?;
|
let (s, b) = paren(event_expression)(s)?;
|
||||||
@ -74,6 +81,7 @@ pub(crate) fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
|
pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
|
||||||
alt((
|
alt((
|
||||||
clocking_item_default,
|
clocking_item_default,
|
||||||
@ -83,6 +91,7 @@ pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
|
pub(crate) fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
let (s, b) = default_skew(s)?;
|
let (s, b) = default_skew(s)?;
|
||||||
@ -94,6 +103,7 @@ pub(crate) fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
|
pub(crate) fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
|
||||||
let (s, a) = clocking_direction(s)?;
|
let (s, a) = clocking_direction(s)?;
|
||||||
let (s, b) = list_of_clocking_decl_assign(s)?;
|
let (s, b) = list_of_clocking_decl_assign(s)?;
|
||||||
@ -105,6 +115,7 @@ pub(crate) fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
|
pub(crate) fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = assertion_item_declaration(s)?;
|
let (s, b) = assertion_item_declaration(s)?;
|
||||||
@ -115,6 +126,7 @@ pub(crate) fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
|
pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
|
||||||
alt((
|
alt((
|
||||||
default_skew_input,
|
default_skew_input,
|
||||||
@ -124,6 +136,7 @@ pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
|
pub(crate) fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = clocking_skew(s)?;
|
let (s, b) = clocking_skew(s)?;
|
||||||
@ -134,6 +147,7 @@ pub(crate) fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
|
pub(crate) fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
|
||||||
let (s, a) = keyword("output")(s)?;
|
let (s, a) = keyword("output")(s)?;
|
||||||
let (s, b) = clocking_skew(s)?;
|
let (s, b) = clocking_skew(s)?;
|
||||||
@ -144,6 +158,7 @@ pub(crate) fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
|
pub(crate) fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = clocking_skew(s)?;
|
let (s, b) = clocking_skew(s)?;
|
||||||
@ -158,6 +173,7 @@ pub(crate) fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
|
pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
|
||||||
alt((
|
alt((
|
||||||
clocking_direction_input,
|
clocking_direction_input,
|
||||||
@ -168,6 +184,7 @@ pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
|
pub(crate) fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = opt(clocking_skew)(s)?;
|
let (s, b) = opt(clocking_skew)(s)?;
|
||||||
@ -178,6 +195,7 @@ pub(crate) fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirecti
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
|
pub(crate) fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
|
||||||
let (s, a) = keyword("output")(s)?;
|
let (s, a) = keyword("output")(s)?;
|
||||||
let (s, b) = opt(clocking_skew)(s)?;
|
let (s, b) = opt(clocking_skew)(s)?;
|
||||||
@ -188,6 +206,7 @@ pub(crate) fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirect
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_direction_input_output(s: Span) -> IResult<Span, ClockingDirection> {
|
pub(crate) fn clocking_direction_input_output(s: Span) -> IResult<Span, ClockingDirection> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = opt(clocking_skew)(s)?;
|
let (s, b) = opt(clocking_skew)(s)?;
|
||||||
@ -202,18 +221,21 @@ pub(crate) fn clocking_direction_input_output(s: Span) -> IResult<Span, Clocking
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_direction_inout(s: Span) -> IResult<Span, ClockingDirection> {
|
pub(crate) fn clocking_direction_inout(s: Span) -> IResult<Span, ClockingDirection> {
|
||||||
let (s, a) = keyword("inout")(s)?;
|
let (s, a) = keyword("inout")(s)?;
|
||||||
Ok((s, ClockingDirection::Inout(Box::new(a))))
|
Ok((s, ClockingDirection::Inout(Box::new(a))))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_clocking_decl_assign(s: Span) -> IResult<Span, ListOfClockingDeclAssign> {
|
pub(crate) fn list_of_clocking_decl_assign(s: Span) -> IResult<Span, ListOfClockingDeclAssign> {
|
||||||
let (s, a) = list(symbol(","), clocking_decl_assign)(s)?;
|
let (s, a) = list(symbol(","), clocking_decl_assign)(s)?;
|
||||||
Ok((s, ListOfClockingDeclAssign { nodes: (a,) }))
|
Ok((s, ListOfClockingDeclAssign { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_decl_assign(s: Span) -> IResult<Span, ClockingDeclAssign> {
|
pub(crate) fn clocking_decl_assign(s: Span) -> IResult<Span, ClockingDeclAssign> {
|
||||||
let (s, a) = signal_identifier(s)?;
|
let (s, a) = signal_identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("="), expression))(s)?;
|
let (s, b) = opt(pair(symbol("="), expression))(s)?;
|
||||||
@ -221,6 +243,7 @@ pub(crate) fn clocking_decl_assign(s: Span) -> IResult<Span, ClockingDeclAssign>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
|
pub(crate) fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
|
||||||
alt((
|
alt((
|
||||||
clocking_skew_edge,
|
clocking_skew_edge,
|
||||||
@ -229,6 +252,7 @@ pub(crate) fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
|
pub(crate) fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
|
||||||
let (s, a) = edge_identifier(s)?;
|
let (s, a) = edge_identifier(s)?;
|
||||||
let (s, b) = opt(delay_control)(s)?;
|
let (s, b) = opt(delay_control)(s)?;
|
||||||
@ -239,6 +263,7 @@ pub(crate) fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
|
pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
|
||||||
let (s, a) = clockvar_expression(s)?;
|
let (s, a) = clockvar_expression(s)?;
|
||||||
let (s, b) = symbol("<=")(s)?;
|
let (s, b) = symbol("<=")(s)?;
|
||||||
@ -253,6 +278,7 @@ pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
|
pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
|
||||||
alt((
|
alt((
|
||||||
cycle_delay_integral,
|
cycle_delay_integral,
|
||||||
@ -262,6 +288,7 @@ pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
|
pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = integral_number(s)?;
|
let (s, b) = integral_number(s)?;
|
||||||
@ -272,6 +299,7 @@ pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
|
pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = identifier(s)?;
|
let (s, b) = identifier(s)?;
|
||||||
@ -282,6 +310,7 @@ pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
|
pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -292,12 +321,14 @@ pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clockvar(s: Span) -> IResult<Span, Clockvar> {
|
pub(crate) fn clockvar(s: Span) -> IResult<Span, Clockvar> {
|
||||||
let (s, a) = hierarchical_identifier(s)?;
|
let (s, a) = hierarchical_identifier(s)?;
|
||||||
Ok((s, Clockvar { nodes: (a,) }))
|
Ok((s, Clockvar { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn clockvar_expression(s: Span) -> IResult<Span, ClockvarExpression> {
|
pub(crate) fn clockvar_expression(s: Span) -> IResult<Span, ClockvarExpression> {
|
||||||
let (s, a) = clockvar(s)?;
|
let (s, a) = clockvar(s)?;
|
||||||
let (s, b) = select(s)?;
|
let (s, b) = select(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
|
pub(crate) fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
|
||||||
let (s, a) = opt(unique_priority)(s)?;
|
let (s, a) = opt(unique_priority)(s)?;
|
||||||
let (s, b) = keyword("if")(s)?;
|
let (s, b) = keyword("if")(s)?;
|
||||||
@ -25,6 +26,7 @@ pub(crate) fn conditional_statement(s: Span) -> IResult<Span, ConditionalStateme
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
|
pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("unique0"), |x| UniquePriority::Unique0(Box::new(x))),
|
map(keyword("unique0"), |x| UniquePriority::Unique0(Box::new(x))),
|
||||||
@ -37,12 +39,14 @@ pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cond_predicate(s: Span) -> IResult<Span, CondPredicate> {
|
pub(crate) fn cond_predicate(s: Span) -> IResult<Span, CondPredicate> {
|
||||||
let (s, a) = list(symbol("&&&"), expression_or_cond_pattern)(s)?;
|
let (s, a) = list(symbol("&&&"), expression_or_cond_pattern)(s)?;
|
||||||
Ok((s, CondPredicate { nodes: (a,) }))
|
Ok((s, CondPredicate { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrCondPattern> {
|
pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrCondPattern> {
|
||||||
alt((
|
alt((
|
||||||
map(expression, |x| {
|
map(expression, |x| {
|
||||||
@ -56,6 +60,7 @@ pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrC
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cond_pattern(s: Span) -> IResult<Span, CondPattern> {
|
pub(crate) fn cond_pattern(s: Span) -> IResult<Span, CondPattern> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = keyword("matches")(s)?;
|
let (s, b) = keyword("matches")(s)?;
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn continuous_assign(s: Span) -> IResult<Span, ContinuousAssign> {
|
pub(crate) fn continuous_assign(s: Span) -> IResult<Span, ContinuousAssign> {
|
||||||
alt((continuous_assign_net, continuous_assign_variable))(s)
|
alt((continuous_assign_net, continuous_assign_variable))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
|
pub(crate) fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
|
||||||
let (s, a) = keyword("assign")(s)?;
|
let (s, a) = keyword("assign")(s)?;
|
||||||
let (s, b) = opt(drive_strength)(s)?;
|
let (s, b) = opt(drive_strength)(s)?;
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
|
pub(crate) fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
|
||||||
let (s, a) = keyword("assign")(s)?;
|
let (s, a) = keyword("assign")(s)?;
|
||||||
let (s, b) = opt(delay_control)(s)?;
|
let (s, b) = opt(delay_control)(s)?;
|
||||||
@ -40,6 +43,7 @@ pub(crate) fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAss
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_net_assignments(s: Span) -> IResult<Span, ListOfNetAssignments> {
|
pub(crate) fn list_of_net_assignments(s: Span) -> IResult<Span, ListOfNetAssignments> {
|
||||||
let (s, a) = list(symbol(","), net_assignment)(s)?;
|
let (s, a) = list(symbol(","), net_assignment)(s)?;
|
||||||
Ok((s, ListOfNetAssignments { nodes: (a,) }))
|
Ok((s, ListOfNetAssignments { nodes: (a,) }))
|
||||||
@ -47,12 +51,14 @@ pub(crate) fn list_of_net_assignments(s: Span) -> IResult<Span, ListOfNetAssignm
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_variable_assignments(s: Span) -> IResult<Span, ListOfVariableAssignments> {
|
pub(crate) fn list_of_variable_assignments(s: Span) -> IResult<Span, ListOfVariableAssignments> {
|
||||||
let (s, a) = list(symbol(","), variable_assignment)(s)?;
|
let (s, a) = list(symbol(","), variable_assignment)(s)?;
|
||||||
Ok((s, ListOfVariableAssignments { nodes: (a,) }))
|
Ok((s, ListOfVariableAssignments { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
|
pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
|
||||||
let (s, a) = keyword("alias")(s)?;
|
let (s, a) = keyword("alias")(s)?;
|
||||||
let (s, b) = net_lvalue(s)?;
|
let (s, b) = net_lvalue(s)?;
|
||||||
@ -70,6 +76,7 @@ pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_assignment(s: Span) -> IResult<Span, NetAssignment> {
|
pub(crate) fn net_assignment(s: Span) -> IResult<Span, NetAssignment> {
|
||||||
let (s, a) = net_lvalue(s)?;
|
let (s, a) = net_lvalue(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
alt((
|
alt((
|
||||||
loop_statement_forever,
|
loop_statement_forever,
|
||||||
@ -15,6 +16,7 @@ pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("forever")(s)?;
|
let (s, a) = keyword("forever")(s)?;
|
||||||
let (s, b) = statement_or_null(s)?;
|
let (s, b) = statement_or_null(s)?;
|
||||||
@ -25,6 +27,7 @@ pub(crate) fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("repeat")(s)?;
|
let (s, a) = keyword("repeat")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -36,6 +39,7 @@ pub(crate) fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("while")(s)?;
|
let (s, a) = keyword("while")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -47,6 +51,7 @@ pub(crate) fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("for")(s)?;
|
let (s, a) = keyword("for")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -64,6 +69,7 @@ pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("do")(s)?;
|
let (s, a) = keyword("do")(s)?;
|
||||||
let (s, b) = statement_or_null(s)?;
|
let (s, b) = statement_or_null(s)?;
|
||||||
@ -79,6 +85,7 @@ pub(crate) fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
|
pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
|
||||||
let (s, a) = keyword("foreach")(s)?;
|
let (s, a) = keyword("foreach")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -93,6 +100,7 @@ pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
|
pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
|
||||||
alt((
|
alt((
|
||||||
map(list_of_variable_assignments, |x| {
|
map(list_of_variable_assignments, |x| {
|
||||||
@ -104,6 +112,7 @@ pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitialization> {
|
pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitialization> {
|
||||||
let (s, a) = list(symbol(","), for_variable_declaration)(s)?;
|
let (s, a) = list(symbol(","), for_variable_declaration)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -113,6 +122,7 @@ pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitia
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration> {
|
pub(crate) fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration> {
|
||||||
let (s, a) = opt(var)(s)?;
|
let (s, a) = opt(var)(s)?;
|
||||||
let (s, b) = data_type(s)?;
|
let (s, b) = data_type(s)?;
|
||||||
@ -124,6 +134,7 @@ pub(crate) fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn var(s: Span) -> IResult<Span, Var> {
|
pub(crate) fn var(s: Span) -> IResult<Span, Var> {
|
||||||
let (s, a) = keyword("var")(s)?;
|
let (s, a) = keyword("var")(s)?;
|
||||||
Ok((s, Var { nodes: (a,) }))
|
Ok((s, Var { nodes: (a,) }))
|
||||||
@ -131,12 +142,14 @@ pub(crate) fn var(s: Span) -> IResult<Span, Var> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn for_step(s: Span) -> IResult<Span, ForStep> {
|
pub(crate) fn for_step(s: Span) -> IResult<Span, ForStep> {
|
||||||
let (s, a) = list(symbol(","), for_step_assignment)(s)?;
|
let (s, a) = list(symbol(","), for_step_assignment)(s)?;
|
||||||
Ok((s, ForStep { nodes: (a,) }))
|
Ok((s, ForStep { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
|
pub(crate) fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
|
||||||
alt((
|
alt((
|
||||||
map(operator_assignment, |x| {
|
map(operator_assignment, |x| {
|
||||||
@ -152,6 +165,7 @@ pub(crate) fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_variables(s: Span) -> IResult<Span, LoopVariables> {
|
pub(crate) fn loop_variables(s: Span) -> IResult<Span, LoopVariables> {
|
||||||
let (s, a) = list(symbol(","), opt(index_variable_identifier))(s)?;
|
let (s, a) = list(symbol(","), opt(index_variable_identifier))(s)?;
|
||||||
Ok((s, LoopVariables { nodes: (a,) }))
|
Ok((s, LoopVariables { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
|
pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
|
||||||
alt((
|
alt((
|
||||||
map(statement_or_null, |x| {
|
map(statement_or_null, |x| {
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
|
pub(crate) fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
|
||||||
let (s, a) = opt(statement)(s)?;
|
let (s, a) = opt(statement)(s)?;
|
||||||
let (s, b) = keyword("else")(s)?;
|
let (s, b) = keyword("else")(s)?;
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
|
pub(crate) fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
|
||||||
let (s, a) = keyword("begin")(s)?;
|
let (s, a) = keyword("begin")(s)?;
|
||||||
let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?;
|
let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?;
|
||||||
@ -40,6 +43,7 @@ pub(crate) fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn par_block(s: Span) -> IResult<Span, ParBlock> {
|
pub(crate) fn par_block(s: Span) -> IResult<Span, ParBlock> {
|
||||||
let (s, a) = keyword("fork")(s)?;
|
let (s, a) = keyword("fork")(s)?;
|
||||||
let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?;
|
let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?;
|
||||||
@ -56,6 +60,7 @@ pub(crate) fn par_block(s: Span) -> IResult<Span, ParBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn join_keyword(s: Span) -> IResult<Span, JoinKeyword> {
|
pub(crate) fn join_keyword(s: Span) -> IResult<Span, JoinKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("join_any"), |x| JoinKeyword::JoinAny(Box::new(x))),
|
map(keyword("join_any"), |x| JoinKeyword::JoinAny(Box::new(x))),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
|
pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
|
||||||
alt((
|
alt((
|
||||||
pattern_variable,
|
pattern_variable,
|
||||||
@ -17,6 +18,7 @@ pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
|
pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
|
||||||
let (s, a) = symbol(".")(s)?;
|
let (s, a) = symbol(".")(s)?;
|
||||||
let (s, b) = variable_identifier(s)?;
|
let (s, b) = variable_identifier(s)?;
|
||||||
@ -27,6 +29,7 @@ pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
|
pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
|
||||||
let (s, a) = keyword("tagged")(s)?;
|
let (s, a) = keyword("tagged")(s)?;
|
||||||
let (s, b) = member_identifier(s)?;
|
let (s, b) = member_identifier(s)?;
|
||||||
@ -38,12 +41,14 @@ pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pattern_list(s: Span) -> IResult<Span, Pattern> {
|
pub(crate) fn pattern_list(s: Span) -> IResult<Span, Pattern> {
|
||||||
let (s, a) = apostrophe_brace(list(symbol(","), pattern))(s)?;
|
let (s, a) = apostrophe_brace(list(symbol(","), pattern))(s)?;
|
||||||
Ok((s, Pattern::List(Box::new(PatternList { nodes: (a,) }))))
|
Ok((s, Pattern::List(Box::new(PatternList { nodes: (a,) }))))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
|
pub(crate) fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
|
||||||
let (s, a) = apostrophe_brace(list(
|
let (s, a) = apostrophe_brace(list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -56,6 +61,7 @@ pub(crate) fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
|
pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
|
||||||
alt((
|
alt((
|
||||||
assignment_pattern_list,
|
assignment_pattern_list,
|
||||||
@ -66,6 +72,7 @@ pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
|
pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
|
||||||
let (s, a) = apostrophe_brace(list(symbol(","), expression))(s)?;
|
let (s, a) = apostrophe_brace(list(symbol(","), expression))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -75,6 +82,7 @@ pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPatter
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern> {
|
pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern> {
|
||||||
let (s, a) = apostrophe_brace(list(
|
let (s, a) = apostrophe_brace(list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -87,6 +95,7 @@ pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
|
pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
|
||||||
let (s, a) = apostrophe_brace(list(
|
let (s, a) = apostrophe_brace(list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -99,6 +108,7 @@ pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPatte
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
|
pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
|
||||||
let (s, a) = apostrophe_brace(pair(
|
let (s, a) = apostrophe_brace(pair(
|
||||||
constant_expression,
|
constant_expression,
|
||||||
@ -111,6 +121,7 @@ pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPatt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
|
pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
|
||||||
alt((
|
alt((
|
||||||
map(member_identifier, |x| {
|
map(member_identifier, |x| {
|
||||||
@ -123,6 +134,7 @@ pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
|
pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
|
||||||
alt((
|
alt((
|
||||||
map(constant_expression, |x| {
|
map(constant_expression, |x| {
|
||||||
@ -135,6 +147,7 @@ pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
|
pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
|
||||||
alt((
|
alt((
|
||||||
map(simple_type, |x| {
|
map(simple_type, |x| {
|
||||||
@ -146,8 +159,8 @@ pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPattern
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_expression(s: Span) -> IResult<Span, AssignmentPatternExpression> {
|
pub(crate) fn assignment_pattern_expression(s: Span) -> IResult<Span, AssignmentPatternExpression> {
|
||||||
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
||||||
let (s, b) = assignment_pattern(s)?;
|
let (s, b) = assignment_pattern(s)?;
|
||||||
@ -155,6 +168,7 @@ pub(crate) fn assignment_pattern_expression(s: Span) -> IResult<Span, Assignment
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_expression_type(
|
pub(crate) fn assignment_pattern_expression_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, AssignmentPatternExpressionType> {
|
) -> IResult<Span, AssignmentPatternExpressionType> {
|
||||||
@ -175,6 +189,7 @@ pub(crate) fn assignment_pattern_expression_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_assignment_pattern_expression(
|
pub(crate) fn constant_assignment_pattern_expression(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConstantAssignmentPatternExpression> {
|
) -> IResult<Span, ConstantAssignmentPatternExpression> {
|
||||||
@ -183,12 +198,14 @@ pub(crate) fn constant_assignment_pattern_expression(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_net_lvalue(s: Span) -> IResult<Span, AssignmentPatternNetLvalue> {
|
pub(crate) fn assignment_pattern_net_lvalue(s: Span) -> IResult<Span, AssignmentPatternNetLvalue> {
|
||||||
let (s, a) = apostrophe_brace(list(symbol(","), net_lvalue))(s)?;
|
let (s, a) = apostrophe_brace(list(symbol(","), net_lvalue))(s)?;
|
||||||
Ok((s, AssignmentPatternNetLvalue { nodes: (a,) }))
|
Ok((s, AssignmentPatternNetLvalue { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_pattern_variable_lvalue(
|
pub(crate) fn assignment_pattern_variable_lvalue(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, AssignmentPatternVariableLvalue> {
|
) -> IResult<Span, AssignmentPatternVariableLvalue> {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn initial_construct(s: Span) -> IResult<Span, InitialConstruct> {
|
pub(crate) fn initial_construct(s: Span) -> IResult<Span, InitialConstruct> {
|
||||||
let (s, a) = keyword("initial")(s)?;
|
let (s, a) = keyword("initial")(s)?;
|
||||||
let (s, b) = statement_or_null(s)?;
|
let (s, b) = statement_or_null(s)?;
|
||||||
@ -10,6 +11,7 @@ pub(crate) fn initial_construct(s: Span) -> IResult<Span, InitialConstruct> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn always_construct(s: Span) -> IResult<Span, AlwaysConstruct> {
|
pub(crate) fn always_construct(s: Span) -> IResult<Span, AlwaysConstruct> {
|
||||||
let (s, a) = always_keyword(s)?;
|
let (s, a) = always_keyword(s)?;
|
||||||
let (s, b) = statement(s)?;
|
let (s, b) = statement(s)?;
|
||||||
@ -17,6 +19,7 @@ pub(crate) fn always_construct(s: Span) -> IResult<Span, AlwaysConstruct> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
|
pub(crate) fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("always_comb"), |x| {
|
map(keyword("always_comb"), |x| {
|
||||||
@ -33,6 +36,7 @@ pub(crate) fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn final_construct(s: Span) -> IResult<Span, FinalConstruct> {
|
pub(crate) fn final_construct(s: Span) -> IResult<Span, FinalConstruct> {
|
||||||
let (s, a) = keyword("final")(s)?;
|
let (s, a) = keyword("final")(s)?;
|
||||||
let (s, b) = function_statement(s)?;
|
let (s, b) = function_statement(s)?;
|
||||||
@ -40,6 +44,7 @@ pub(crate) fn final_construct(s: Span) -> IResult<Span, FinalConstruct> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment> {
|
pub(crate) fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment> {
|
||||||
alt((
|
alt((
|
||||||
blocking_assignment_variable,
|
blocking_assignment_variable,
|
||||||
@ -53,6 +58,7 @@ pub(crate) fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment> {
|
pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment> {
|
||||||
let (s, a) = variable_lvalue(s)?;
|
let (s, a) = variable_lvalue(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -68,6 +74,7 @@ pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAss
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingAssignment> {
|
pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingAssignment> {
|
||||||
let (s, a) = nonrange_variable_lvalue(s)?;
|
let (s, a) = nonrange_variable_lvalue(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -81,6 +88,7 @@ pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, Bl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn blocking_assignment_hierarchical_variable(
|
pub(crate) fn blocking_assignment_hierarchical_variable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, BlockingAssignment> {
|
) -> IResult<Span, BlockingAssignment> {
|
||||||
@ -101,6 +109,7 @@ pub(crate) fn blocking_assignment_hierarchical_variable(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
|
pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
|
||||||
let (s, a) = variable_lvalue(s)?;
|
let (s, a) = variable_lvalue(s)?;
|
||||||
let (s, b) = assignment_operator(s)?;
|
let (s, b) = assignment_operator(s)?;
|
||||||
@ -109,6 +118,7 @@ pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
|
pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("="), |x| AssignmentOperator { nodes: (x,) }),
|
map(symbol("="), |x| AssignmentOperator { nodes: (x,) }),
|
||||||
@ -129,6 +139,7 @@ pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
|
pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
|
||||||
let (s, a) = variable_lvalue(s)?;
|
let (s, a) = variable_lvalue(s)?;
|
||||||
let (s, b) = symbol("<=")(s)?;
|
let (s, b) = symbol("<=")(s)?;
|
||||||
@ -143,6 +154,7 @@ pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssign
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment(
|
pub(crate) fn procedural_continuous_assignment(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -157,6 +169,7 @@ pub(crate) fn procedural_continuous_assignment(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_assign(
|
pub(crate) fn procedural_continuous_assignment_assign(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -171,6 +184,7 @@ pub(crate) fn procedural_continuous_assignment_assign(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_deassign(
|
pub(crate) fn procedural_continuous_assignment_deassign(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -185,6 +199,7 @@ pub(crate) fn procedural_continuous_assignment_deassign(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_force_variable(
|
pub(crate) fn procedural_continuous_assignment_force_variable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -199,6 +214,7 @@ pub(crate) fn procedural_continuous_assignment_force_variable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_force_net(
|
pub(crate) fn procedural_continuous_assignment_force_net(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -213,6 +229,7 @@ pub(crate) fn procedural_continuous_assignment_force_net(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_release_variable(
|
pub(crate) fn procedural_continuous_assignment_release_variable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -227,6 +244,7 @@ pub(crate) fn procedural_continuous_assignment_release_variable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_continuous_assignment_release_net(
|
pub(crate) fn procedural_continuous_assignment_release_net(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralContinuousAssignment> {
|
) -> IResult<Span, ProceduralContinuousAssignment> {
|
||||||
@ -242,6 +260,7 @@ pub(crate) fn procedural_continuous_assignment_release_net(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_assignment(s: Span) -> IResult<Span, VariableAssignment> {
|
pub(crate) fn variable_assignment(s: Span) -> IResult<Span, VariableAssignment> {
|
||||||
let (s, a) = variable_lvalue(s)?;
|
let (s, a) = variable_lvalue(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
|
pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
|
||||||
let (s, a) = keyword("randsequence")(s)?;
|
let (s, a) = keyword("randsequence")(s)?;
|
||||||
let (s, b) = paren(opt(production_identifier))(s)?;
|
let (s, b) = paren(opt(production_identifier))(s)?;
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceState
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn production(s: Span) -> IResult<Span, Production> {
|
pub(crate) fn production(s: Span) -> IResult<Span, Production> {
|
||||||
let (s, a) = opt(data_type_or_void)(s)?;
|
let (s, a) = opt(data_type_or_void)(s)?;
|
||||||
let (s, b) = production_identifier(s)?;
|
let (s, b) = production_identifier(s)?;
|
||||||
@ -34,6 +36,7 @@ pub(crate) fn production(s: Span) -> IResult<Span, Production> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
|
pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
|
||||||
let (s, a) = rs_production_list(s)?;
|
let (s, a) = rs_production_list(s)?;
|
||||||
let (s, b) = opt(triple(
|
let (s, b) = opt(triple(
|
||||||
@ -45,11 +48,13 @@ pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_production_list(s: Span) -> IResult<Span, RsProductionList> {
|
pub(crate) fn rs_production_list(s: Span) -> IResult<Span, RsProductionList> {
|
||||||
alt((rs_production_list_prod, rs_production_list_join))(s)
|
alt((rs_production_list_prod, rs_production_list_join))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList> {
|
pub(crate) fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList> {
|
||||||
let (s, a) = rs_prod(s)?;
|
let (s, a) = rs_prod(s)?;
|
||||||
let (s, b) = many0(rs_prod)(s)?;
|
let (s, b) = many0(rs_prod)(s)?;
|
||||||
@ -60,6 +65,7 @@ pub(crate) fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
|
pub(crate) fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
|
||||||
let (s, a) = keyword("rand")(s)?;
|
let (s, a) = keyword("rand")(s)?;
|
||||||
let (s, b) = keyword("join")(s)?;
|
let (s, b) = keyword("join")(s)?;
|
||||||
@ -76,6 +82,7 @@ pub(crate) fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
|
pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
|
||||||
alt((
|
alt((
|
||||||
map(integral_number, |x| {
|
map(integral_number, |x| {
|
||||||
@ -89,6 +96,7 @@ pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecification> {
|
pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecification> {
|
||||||
let (s, a) = paren(expression)(s)?;
|
let (s, a) = paren(expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -98,12 +106,14 @@ pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_code_block(s: Span) -> IResult<Span, RsCodeBlock> {
|
pub(crate) fn rs_code_block(s: Span) -> IResult<Span, RsCodeBlock> {
|
||||||
let (s, a) = brace(pair(many0(data_declaration), many0(statement_or_null)))(s)?;
|
let (s, a) = brace(pair(many0(data_declaration), many0(statement_or_null)))(s)?;
|
||||||
Ok((s, RsCodeBlock { nodes: (a,) }))
|
Ok((s, RsCodeBlock { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_prod(s: Span) -> IResult<Span, RsProd> {
|
pub(crate) fn rs_prod(s: Span) -> IResult<Span, RsProd> {
|
||||||
alt((
|
alt((
|
||||||
map(production_item, |x| RsProd::ProductionItem(Box::new(x))),
|
map(production_item, |x| RsProd::ProductionItem(Box::new(x))),
|
||||||
@ -115,6 +125,7 @@ pub(crate) fn rs_prod(s: Span) -> IResult<Span, RsProd> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn production_item(s: Span) -> IResult<Span, ProductionItem> {
|
pub(crate) fn production_item(s: Span) -> IResult<Span, ProductionItem> {
|
||||||
let (s, a) = production_identifier(s)?;
|
let (s, a) = production_identifier(s)?;
|
||||||
let (s, b) = opt(paren(list_of_arguments))(s)?;
|
let (s, b) = opt(paren(list_of_arguments))(s)?;
|
||||||
@ -122,6 +133,7 @@ pub(crate) fn production_item(s: Span) -> IResult<Span, ProductionItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
|
pub(crate) fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
|
||||||
let (s, a) = keyword("if")(s)?;
|
let (s, a) = keyword("if")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -136,6 +148,7 @@ pub(crate) fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
|
pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
|
||||||
let (s, a) = keyword("repeat")(s)?;
|
let (s, a) = keyword("repeat")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -144,6 +157,7 @@ pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_case(s: Span) -> IResult<Span, RsCase> {
|
pub(crate) fn rs_case(s: Span) -> IResult<Span, RsCase> {
|
||||||
let (s, a) = keyword("case")(s)?;
|
let (s, a) = keyword("case")(s)?;
|
||||||
let (s, b) = paren(case_expression)(s)?;
|
let (s, b) = paren(case_expression)(s)?;
|
||||||
@ -159,12 +173,14 @@ pub(crate) fn rs_case(s: Span) -> IResult<Span, RsCase> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_case_item(s: Span) -> IResult<Span, RsCaseItem> {
|
pub(crate) fn rs_case_item(s: Span) -> IResult<Span, RsCaseItem> {
|
||||||
alt((rs_case_item_nondefault, rs_case_item_default))(s)
|
alt((rs_case_item_nondefault, rs_case_item_default))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_case_item_nondefault(s: Span) -> IResult<Span, RsCaseItem> {
|
pub(crate) fn rs_case_item_nondefault(s: Span) -> IResult<Span, RsCaseItem> {
|
||||||
let (s, a) = list(symbol(","), case_item_expression)(s)?;
|
let (s, a) = list(symbol(","), case_item_expression)(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -179,6 +195,7 @@ pub(crate) fn rs_case_item_nondefault(s: Span) -> IResult<Span, RsCaseItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rs_case_item_default(s: Span) -> IResult<Span, RsCaseItem> {
|
pub(crate) fn rs_case_item_default(s: Span) -> IResult<Span, RsCaseItem> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
let (s, b) = opt(symbol(":"))(s)?;
|
let (s, b) = opt(symbol(":"))(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
|
pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
|
||||||
alt((
|
alt((
|
||||||
map(statement, |x| StatementOrNull::Statement(Box::new(x))),
|
map(statement, |x| StatementOrNull::Statement(Box::new(x))),
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
|
pub(crate) fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = symbol(";")(s)?;
|
let (s, b) = symbol(";")(s)?;
|
||||||
@ -22,6 +24,7 @@ pub(crate) fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrN
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn statement(s: Span) -> IResult<Span, Statement> {
|
pub(crate) fn statement(s: Span) -> IResult<Span, Statement> {
|
||||||
let (s, a) = opt(pair(block_identifier, symbol(":")))(s)?;
|
let (s, a) = opt(pair(block_identifier, symbol(":")))(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -30,6 +33,7 @@ pub(crate) fn statement(s: Span) -> IResult<Span, Statement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
|
pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(blocking_assignment, symbol(";")), |x| {
|
map(pair(blocking_assignment, symbol(";")), |x| {
|
||||||
@ -90,12 +94,14 @@ pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_statement(s: Span) -> IResult<Span, FunctionStatement> {
|
pub(crate) fn function_statement(s: Span) -> IResult<Span, FunctionStatement> {
|
||||||
let (s, a) = statement(s)?;
|
let (s, a) = statement(s)?;
|
||||||
Ok((s, FunctionStatement { nodes: (a,) }))
|
Ok((s, FunctionStatement { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrNull> {
|
pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrNull> {
|
||||||
alt((
|
alt((
|
||||||
map(function_statement, |x| {
|
map(function_statement, |x| {
|
||||||
@ -106,6 +112,7 @@ pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionState
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_statement_or_null_attribute(
|
pub(crate) fn function_statement_or_null_attribute(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, FunctionStatementOrNull> {
|
) -> IResult<Span, FunctionStatementOrNull> {
|
||||||
@ -120,6 +127,7 @@ pub(crate) fn function_statement_or_null_attribute(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_identifier_list(s: Span) -> IResult<Span, VariableIdentifierList> {
|
pub(crate) fn variable_identifier_list(s: Span) -> IResult<Span, VariableIdentifierList> {
|
||||||
let (s, a) = list(symbol(","), variable_identifier)(s)?;
|
let (s, a) = list(symbol(","), variable_identifier)(s)?;
|
||||||
Ok((s, VariableIdentifierList { nodes: (a,) }))
|
Ok((s, VariableIdentifierList { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStatement> {
|
pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStatement> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(subroutine_call, symbol(";")), |x| {
|
map(pair(subroutine_call, symbol(";")), |x| {
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn subroutine_call_statement_function(
|
pub(crate) fn subroutine_call_statement_function(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SubroutineCallStatement> {
|
) -> IResult<Span, SubroutineCallStatement> {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_timing_control_statement(
|
pub(crate) fn procedural_timing_control_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ProceduralTimingControlStatement> {
|
) -> IResult<Span, ProceduralTimingControlStatement> {
|
||||||
@ -12,6 +13,7 @@ pub(crate) fn procedural_timing_control_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventControl> {
|
pub(crate) fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventControl> {
|
||||||
alt((
|
alt((
|
||||||
map(delay_control, |x| DelayOrEventControl::Delay(Box::new(x))),
|
map(delay_control, |x| DelayOrEventControl::Delay(Box::new(x))),
|
||||||
@ -21,6 +23,7 @@ pub(crate) fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventContr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEventControl> {
|
pub(crate) fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEventControl> {
|
||||||
let (s, a) = keyword("repeat")(s)?;
|
let (s, a) = keyword("repeat")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -32,11 +35,13 @@ pub(crate) fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEve
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_control(s: Span) -> IResult<Span, DelayControl> {
|
pub(crate) fn delay_control(s: Span) -> IResult<Span, DelayControl> {
|
||||||
alt((delay_control_delay, delay_control_mintypmax))(s)
|
alt((delay_control_delay, delay_control_mintypmax))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
|
pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = delay_value(s)?;
|
let (s, b) = delay_value(s)?;
|
||||||
@ -47,6 +52,7 @@ pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
|
pub(crate) fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(mintypmax_expression)(s)?;
|
let (s, b) = paren(mintypmax_expression)(s)?;
|
||||||
@ -57,6 +63,7 @@ pub(crate) fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
|
||||||
alt((
|
alt((
|
||||||
event_control_event_identifier,
|
event_control_event_identifier,
|
||||||
@ -68,6 +75,7 @@ pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = hierarchical_event_identifier(s)?;
|
let (s, b) = hierarchical_event_identifier(s)?;
|
||||||
@ -78,6 +86,7 @@ pub(crate) fn event_control_event_identifier(s: Span) -> IResult<Span, EventCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = paren(event_expression)(s)?;
|
let (s, b) = paren(event_expression)(s)?;
|
||||||
@ -88,6 +97,7 @@ pub(crate) fn event_control_event_expression(s: Span) -> IResult<Span, EventCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
|
||||||
let (s, a) = symbol("@*")(s)?;
|
let (s, a) = symbol("@*")(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -97,6 +107,7 @@ pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = paren(symbol("*"))(s)?;
|
let (s, b) = paren(symbol("*"))(s)?;
|
||||||
@ -107,6 +118,7 @@ pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventContro
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventControl> {
|
pub(crate) fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventControl> {
|
||||||
let (s, a) = symbol("@")(s)?;
|
let (s, a) = symbol("@")(s)?;
|
||||||
let (s, b) = ps_or_hierarchical_sequence_identifier(s)?;
|
let (s, b) = ps_or_hierarchical_sequence_identifier(s)?;
|
||||||
@ -119,6 +131,7 @@ pub(crate) fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventC
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
|
||||||
alt((
|
alt((
|
||||||
event_expression_or,
|
event_expression_or,
|
||||||
@ -131,6 +144,7 @@ pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
|
||||||
let (s, a) = opt(edge_identifier)(s)?;
|
let (s, a) = opt(edge_identifier)(s)?;
|
||||||
let (s, b) = expression(s)?;
|
let (s, b) = expression(s)?;
|
||||||
@ -142,6 +156,7 @@ pub(crate) fn event_expression_expression(s: Span) -> IResult<Span, EventExpress
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression_sequence(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression_sequence(s: Span) -> IResult<Span, EventExpression> {
|
||||||
let (s, a) = sequence_instance(s)?;
|
let (s, a) = sequence_instance(s)?;
|
||||||
let (s, b) = opt(pair(keyword("iff"), expression))(s)?;
|
let (s, b) = opt(pair(keyword("iff"), expression))(s)?;
|
||||||
@ -153,6 +168,7 @@ pub(crate) fn event_expression_sequence(s: Span) -> IResult<Span, EventExpressio
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
|
||||||
let (s, a) = event_expression(s)?;
|
let (s, a) = event_expression(s)?;
|
||||||
let (s, b) = keyword("or")(s)?;
|
let (s, b) = keyword("or")(s)?;
|
||||||
@ -165,6 +181,7 @@ pub(crate) fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
|
||||||
let (s, a) = event_expression(s)?;
|
let (s, a) = event_expression(s)?;
|
||||||
let (s, b) = symbol(",")(s)?;
|
let (s, b) = symbol(",")(s)?;
|
||||||
@ -176,6 +193,7 @@ pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
|
pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
|
||||||
let (s, a) = paren(event_expression)(s)?;
|
let (s, a) = paren(event_expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -185,6 +203,7 @@ pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingControl> {
|
pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingControl> {
|
||||||
alt((
|
alt((
|
||||||
map(delay_control, |x| {
|
map(delay_control, |x| {
|
||||||
@ -200,6 +219,7 @@ pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
|
pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
|
||||||
alt((
|
alt((
|
||||||
jump_statement_return,
|
jump_statement_return,
|
||||||
@ -209,6 +229,7 @@ pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
|
pub(crate) fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
|
||||||
let (s, a) = keyword("return")(s)?;
|
let (s, a) = keyword("return")(s)?;
|
||||||
let (s, b) = opt(expression)(s)?;
|
let (s, b) = opt(expression)(s)?;
|
||||||
@ -220,6 +241,7 @@ pub(crate) fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
|
pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
|
||||||
let (s, a) = keyword("break")(s)?;
|
let (s, a) = keyword("break")(s)?;
|
||||||
let (s, b) = symbol(";")(s)?;
|
let (s, b) = symbol(";")(s)?;
|
||||||
@ -230,6 +252,7 @@ pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
|
pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
|
||||||
let (s, a) = keyword("continue")(s)?;
|
let (s, a) = keyword("continue")(s)?;
|
||||||
let (s, b) = symbol(";")(s)?;
|
let (s, b) = symbol(";")(s)?;
|
||||||
@ -240,6 +263,7 @@ pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
|
pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
|
||||||
alt((
|
alt((
|
||||||
wait_statement_wait,
|
wait_statement_wait,
|
||||||
@ -249,6 +273,7 @@ pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
|
pub(crate) fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
|
||||||
let (s, a) = keyword("wait")(s)?;
|
let (s, a) = keyword("wait")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -260,6 +285,7 @@ pub(crate) fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
|
pub(crate) fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
|
||||||
let (s, a) = keyword("wait")(s)?;
|
let (s, a) = keyword("wait")(s)?;
|
||||||
let (s, b) = keyword("fork")(s)?;
|
let (s, b) = keyword("fork")(s)?;
|
||||||
@ -271,6 +297,7 @@ pub(crate) fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
|
pub(crate) fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
|
||||||
let (s, a) = keyword("wait_order")(s)?;
|
let (s, a) = keyword("wait_order")(s)?;
|
||||||
let (s, b) = paren(list(symbol(","), hierarchical_identifier))(s)?;
|
let (s, b) = paren(list(symbol(","), hierarchical_identifier))(s)?;
|
||||||
@ -282,11 +309,13 @@ pub(crate) fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_trigger(s: Span) -> IResult<Span, EventTrigger> {
|
pub(crate) fn event_trigger(s: Span) -> IResult<Span, EventTrigger> {
|
||||||
alt((event_trigger_named, event_trigger_nonblocking))(s)
|
alt((event_trigger_named, event_trigger_nonblocking))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
|
pub(crate) fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
|
||||||
let (s, a) = symbol("->")(s)?;
|
let (s, a) = symbol("->")(s)?;
|
||||||
let (s, b) = hierarchical_event_identifier(s)?;
|
let (s, b) = hierarchical_event_identifier(s)?;
|
||||||
@ -298,6 +327,7 @@ pub(crate) fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger> {
|
pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger> {
|
||||||
let (s, a) = symbol("->>")(s)?;
|
let (s, a) = symbol("->>")(s)?;
|
||||||
let (s, b) = opt(delay_or_event_control)(s)?;
|
let (s, b) = opt(delay_or_event_control)(s)?;
|
||||||
@ -312,6 +342,7 @@ pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
|
pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
|
||||||
alt((
|
alt((
|
||||||
disable_statement_task,
|
disable_statement_task,
|
||||||
@ -321,6 +352,7 @@ pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
|
pub(crate) fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
|
||||||
let (s, a) = keyword("disable")(s)?;
|
let (s, a) = keyword("disable")(s)?;
|
||||||
let (s, b) = hierarchical_task_identifier(s)?;
|
let (s, b) = hierarchical_task_identifier(s)?;
|
||||||
@ -332,6 +364,7 @@ pub(crate) fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
|
pub(crate) fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
|
||||||
let (s, a) = keyword("disable")(s)?;
|
let (s, a) = keyword("disable")(s)?;
|
||||||
let (s, b) = hierarchical_block_identifier(s)?;
|
let (s, b) = hierarchical_block_identifier(s)?;
|
||||||
@ -343,6 +376,7 @@ pub(crate) fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn disable_statement_fork(s: Span) -> IResult<Span, DisableStatement> {
|
pub(crate) fn disable_statement_fork(s: Span) -> IResult<Span, DisableStatement> {
|
||||||
let (s, a) = keyword("disable")(s)?;
|
let (s, a) = keyword("disable")(s)?;
|
||||||
let (s, b) = keyword("fork")(s)?;
|
let (s, b) = keyword("fork")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
|
pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
|
||||||
alt((
|
alt((
|
||||||
concurrent_assertion_item_statement,
|
concurrent_assertion_item_statement,
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAsse
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn concurrent_assertion_item_statement(
|
pub(crate) fn concurrent_assertion_item_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConcurrentAssertionItem> {
|
) -> IResult<Span, ConcurrentAssertionItem> {
|
||||||
@ -27,6 +29,7 @@ pub(crate) fn concurrent_assertion_item_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn concurrent_assertion_statement(
|
pub(crate) fn concurrent_assertion_statement(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConcurrentAssertionStatement> {
|
) -> IResult<Span, ConcurrentAssertionStatement> {
|
||||||
@ -50,6 +53,7 @@ pub(crate) fn concurrent_assertion_statement(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStatement> {
|
pub(crate) fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStatement> {
|
||||||
let (s, a) = keyword("assert")(s)?;
|
let (s, a) = keyword("assert")(s)?;
|
||||||
let (s, b) = keyword("property")(s)?;
|
let (s, b) = keyword("property")(s)?;
|
||||||
@ -64,6 +68,7 @@ pub(crate) fn assert_property_statement(s: Span) -> IResult<Span, AssertProperty
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStatement> {
|
pub(crate) fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStatement> {
|
||||||
let (s, a) = keyword("assume")(s)?;
|
let (s, a) = keyword("assume")(s)?;
|
||||||
let (s, b) = keyword("property")(s)?;
|
let (s, b) = keyword("property")(s)?;
|
||||||
@ -78,6 +83,7 @@ pub(crate) fn assume_property_statement(s: Span) -> IResult<Span, AssumeProperty
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement> {
|
pub(crate) fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement> {
|
||||||
let (s, a) = keyword("cover")(s)?;
|
let (s, a) = keyword("cover")(s)?;
|
||||||
let (s, b) = keyword("property")(s)?;
|
let (s, b) = keyword("property")(s)?;
|
||||||
@ -92,6 +98,7 @@ pub(crate) fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertySt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStatement> {
|
pub(crate) fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStatement> {
|
||||||
let (s, a) = keyword("expect")(s)?;
|
let (s, a) = keyword("expect")(s)?;
|
||||||
let (s, b) = paren(property_spec)(s)?;
|
let (s, b) = paren(property_spec)(s)?;
|
||||||
@ -100,6 +107,7 @@ pub(crate) fn expect_property_statement(s: Span) -> IResult<Span, ExpectProperty
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement> {
|
pub(crate) fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement> {
|
||||||
let (s, a) = keyword("cover")(s)?;
|
let (s, a) = keyword("cover")(s)?;
|
||||||
let (s, b) = keyword("sequence")(s)?;
|
let (s, b) = keyword("sequence")(s)?;
|
||||||
@ -122,6 +130,7 @@ pub(crate) fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertyStatement> {
|
pub(crate) fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertyStatement> {
|
||||||
let (s, a) = keyword("restrict")(s)?;
|
let (s, a) = keyword("restrict")(s)?;
|
||||||
let (s, b) = keyword("property")(s)?;
|
let (s, b) = keyword("property")(s)?;
|
||||||
@ -136,6 +145,7 @@ pub(crate) fn restrict_property_statement(s: Span) -> IResult<Span, RestrictProp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_instance(s: Span) -> IResult<Span, PropertyInstance> {
|
pub(crate) fn property_instance(s: Span) -> IResult<Span, PropertyInstance> {
|
||||||
let (s, a) = ps_or_hierarchical_property_identifier(s)?;
|
let (s, a) = ps_or_hierarchical_property_identifier(s)?;
|
||||||
let (s, b) = opt(paren(opt(property_list_of_arguments)))(s)?;
|
let (s, b) = opt(paren(opt(property_list_of_arguments)))(s)?;
|
||||||
@ -143,6 +153,7 @@ pub(crate) fn property_instance(s: Span) -> IResult<Span, PropertyInstance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListOfArguments> {
|
pub(crate) fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListOfArguments> {
|
||||||
alt((
|
alt((
|
||||||
property_list_of_arguments_named,
|
property_list_of_arguments_named,
|
||||||
@ -152,6 +163,7 @@ pub(crate) fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListO
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_list_of_arguments_ordered(
|
pub(crate) fn property_list_of_arguments_ordered(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PropertyListOfArguments> {
|
) -> IResult<Span, PropertyListOfArguments> {
|
||||||
@ -171,6 +183,7 @@ pub(crate) fn property_list_of_arguments_ordered(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult<Span, PropertyListOfArguments> {
|
pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult<Span, PropertyListOfArguments> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -183,6 +196,7 @@ pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult<Span, Propert
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
|
pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
|
||||||
alt((
|
alt((
|
||||||
map(property_expr, |x| {
|
map(property_expr, |x| {
|
||||||
@ -195,6 +209,7 @@ pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclaration> {
|
pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
map(property_declaration, |x| {
|
map(property_declaration, |x| {
|
||||||
@ -210,6 +225,7 @@ pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
|
pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
|
||||||
let (s, a) = keyword("property")(s)?;
|
let (s, a) = keyword("property")(s)?;
|
||||||
let (s, b) = property_identifier(s)?;
|
let (s, b) = property_identifier(s)?;
|
||||||
@ -229,12 +245,14 @@ pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_port_list(s: Span) -> IResult<Span, PropertyPortList> {
|
pub(crate) fn property_port_list(s: Span) -> IResult<Span, PropertyPortList> {
|
||||||
let (s, a) = list(symbol(","), property_port_item)(s)?;
|
let (s, a) = list(symbol(","), property_port_item)(s)?;
|
||||||
Ok((s, PropertyPortList { nodes: (a,) }))
|
Ok((s, PropertyPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_port_item(s: Span) -> IResult<Span, PropertyPortItem> {
|
pub(crate) fn property_port_item(s: Span) -> IResult<Span, PropertyPortItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = opt(pair(local, opt(property_lvar_port_direction)))(s)?;
|
let (s, b) = opt(pair(local, opt(property_lvar_port_direction)))(s)?;
|
||||||
@ -251,12 +269,14 @@ pub(crate) fn property_port_item(s: Span) -> IResult<Span, PropertyPortItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_lvar_port_direction(s: Span) -> IResult<Span, PropertyLvarPortDirection> {
|
pub(crate) fn property_lvar_port_direction(s: Span) -> IResult<Span, PropertyLvarPortDirection> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
Ok((s, PropertyLvarPortDirection::Input(Box::new(a))))
|
Ok((s, PropertyLvarPortDirection::Input(Box::new(a))))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType> {
|
pub(crate) fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType> {
|
||||||
alt((
|
alt((
|
||||||
map(sequence_formal_type, |x| {
|
map(sequence_formal_type, |x| {
|
||||||
@ -270,6 +290,7 @@ pub(crate) fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
|
pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
|
||||||
let (s, a) = opt(clocking_event)(s)?;
|
let (s, a) = opt(clocking_event)(s)?;
|
||||||
let (s, b) = opt(triple(
|
let (s, b) = opt(triple(
|
||||||
@ -282,6 +303,7 @@ pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
alt((
|
alt((
|
||||||
alt((
|
alt((
|
||||||
@ -325,6 +347,7 @@ pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("strong")(s)?;
|
let (s, a) = keyword("strong")(s)?;
|
||||||
let (s, b) = paren(sequence_expr)(s)?;
|
let (s, b) = paren(sequence_expr)(s)?;
|
||||||
@ -335,6 +358,7 @@ pub(crate) fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("weak")(s)?;
|
let (s, a) = keyword("weak")(s)?;
|
||||||
let (s, b) = paren(sequence_expr)(s)?;
|
let (s, b) = paren(sequence_expr)(s)?;
|
||||||
@ -345,6 +369,7 @@ pub(crate) fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = paren(sequence_expr)(s)?;
|
let (s, a) = paren(sequence_expr)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -354,6 +379,7 @@ pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("not")(s)?;
|
let (s, a) = keyword("not")(s)?;
|
||||||
let (s, b) = property_expr(s)?;
|
let (s, b) = property_expr(s)?;
|
||||||
@ -365,6 +391,7 @@ pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("or")(s)?;
|
let (s, b) = keyword("or")(s)?;
|
||||||
@ -377,6 +404,7 @@ pub(crate) fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("and")(s)?;
|
let (s, b) = keyword("and")(s)?;
|
||||||
@ -389,6 +417,7 @@ pub(crate) fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = symbol("|->")(s)?;
|
let (s, b) = symbol("|->")(s)?;
|
||||||
@ -403,6 +432,7 @@ pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, Pro
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = symbol("|=>")(s)?;
|
let (s, b) = symbol("|=>")(s)?;
|
||||||
@ -416,6 +446,7 @@ pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("if")(s)?;
|
let (s, a) = keyword("if")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -430,6 +461,7 @@ pub(crate) fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("case")(s)?;
|
let (s, a) = keyword("case")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -446,6 +478,7 @@ pub(crate) fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = symbol("#-#")(s)?;
|
let (s, b) = symbol("#-#")(s)?;
|
||||||
@ -460,6 +493,7 @@ pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, Pro
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = symbol("#=#")(s)?;
|
let (s, b) = symbol("#=#")(s)?;
|
||||||
@ -473,6 +507,7 @@ pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("nexttime")(s)?;
|
let (s, a) = keyword("nexttime")(s)?;
|
||||||
let (s, b) = opt(bracket(constant_expression))(s)?;
|
let (s, b) = opt(bracket(constant_expression))(s)?;
|
||||||
@ -484,6 +519,7 @@ pub(crate) fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("s_nexttime")(s)?;
|
let (s, a) = keyword("s_nexttime")(s)?;
|
||||||
let (s, b) = opt(bracket(constant_expression))(s)?;
|
let (s, b) = opt(bracket(constant_expression))(s)?;
|
||||||
@ -495,6 +531,7 @@ pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("always")(s)?;
|
let (s, a) = keyword("always")(s)?;
|
||||||
let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?;
|
let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?;
|
||||||
@ -506,6 +543,7 @@ pub(crate) fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("s_always")(s)?;
|
let (s, a) = keyword("s_always")(s)?;
|
||||||
let (s, b) = bracket(cycle_delay_const_range_expression)(s)?;
|
let (s, b) = bracket(cycle_delay_const_range_expression)(s)?;
|
||||||
@ -517,6 +555,7 @@ pub(crate) fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("eventually")(s)?;
|
let (s, a) = keyword("eventually")(s)?;
|
||||||
let (s, b) = bracket(constant_range)(s)?;
|
let (s, b) = bracket(constant_range)(s)?;
|
||||||
@ -528,6 +567,7 @@ pub(crate) fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("s_eventually")(s)?;
|
let (s, a) = keyword("s_eventually")(s)?;
|
||||||
let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?;
|
let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?;
|
||||||
@ -540,6 +580,7 @@ pub(crate) fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("until")(s)?;
|
let (s, b) = keyword("until")(s)?;
|
||||||
@ -552,6 +593,7 @@ pub(crate) fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("s_until")(s)?;
|
let (s, b) = keyword("s_until")(s)?;
|
||||||
@ -564,6 +606,7 @@ pub(crate) fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("until_with")(s)?;
|
let (s, b) = keyword("until_with")(s)?;
|
||||||
@ -576,6 +619,7 @@ pub(crate) fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("s_until_with")(s)?;
|
let (s, b) = keyword("s_until_with")(s)?;
|
||||||
@ -588,6 +632,7 @@ pub(crate) fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("implies")(s)?;
|
let (s, b) = keyword("implies")(s)?;
|
||||||
@ -600,6 +645,7 @@ pub(crate) fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = property_expr(s)?;
|
let (s, a) = property_expr(s)?;
|
||||||
let (s, b) = keyword("iff")(s)?;
|
let (s, b) = keyword("iff")(s)?;
|
||||||
@ -611,6 +657,7 @@ pub(crate) fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("accept_on")(s)?;
|
let (s, a) = keyword("accept_on")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -622,6 +669,7 @@ pub(crate) fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("reject_on")(s)?;
|
let (s, a) = keyword("reject_on")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -633,6 +681,7 @@ pub(crate) fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("sync_accept_on")(s)?;
|
let (s, a) = keyword("sync_accept_on")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -644,6 +693,7 @@ pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = keyword("sync_reject_on")(s)?;
|
let (s, a) = keyword("sync_reject_on")(s)?;
|
||||||
let (s, b) = paren(expression_or_dist)(s)?;
|
let (s, b) = paren(expression_or_dist)(s)?;
|
||||||
@ -655,6 +705,7 @@ pub(crate) fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
|
pub(crate) fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
|
||||||
let (s, a) = clocking_event(s)?;
|
let (s, a) = clocking_event(s)?;
|
||||||
let (s, b) = property_expr(s)?;
|
let (s, b) = property_expr(s)?;
|
||||||
@ -665,12 +716,14 @@ pub(crate) fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_case_item(s: Span) -> IResult<Span, PropertyCaseItem> {
|
pub(crate) fn property_case_item(s: Span) -> IResult<Span, PropertyCaseItem> {
|
||||||
alt((property_case_item_nondefault, property_case_item_default))(s)
|
alt((property_case_item_nondefault, property_case_item_default))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_case_item_nondefault(s: Span) -> IResult<Span, PropertyCaseItem> {
|
pub(crate) fn property_case_item_nondefault(s: Span) -> IResult<Span, PropertyCaseItem> {
|
||||||
let (s, a) = list(symbol(","), expression_or_dist)(s)?;
|
let (s, a) = list(symbol(","), expression_or_dist)(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -685,6 +738,7 @@ pub(crate) fn property_case_item_nondefault(s: Span) -> IResult<Span, PropertyCa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
|
pub(crate) fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
let (s, b) = opt(symbol(":"))(s)?;
|
let (s, b) = opt(symbol(":"))(s)?;
|
||||||
@ -699,6 +753,7 @@ pub(crate) fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseI
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
|
pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
|
||||||
let (s, a) = keyword("sequence")(s)?;
|
let (s, a) = keyword("sequence")(s)?;
|
||||||
let (s, b) = sequence_identifier(s)?;
|
let (s, b) = sequence_identifier(s)?;
|
||||||
@ -718,12 +773,14 @@ pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_port_list(s: Span) -> IResult<Span, SequencePortList> {
|
pub(crate) fn sequence_port_list(s: Span) -> IResult<Span, SequencePortList> {
|
||||||
let (s, a) = list(symbol(","), sequence_port_item)(s)?;
|
let (s, a) = list(symbol(","), sequence_port_item)(s)?;
|
||||||
Ok((s, SequencePortList { nodes: (a,) }))
|
Ok((s, SequencePortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_port_item(s: Span) -> IResult<Span, SequencePortItem> {
|
pub(crate) fn sequence_port_item(s: Span) -> IResult<Span, SequencePortItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = opt(pair(local, opt(sequence_lvar_port_direction)))(s)?;
|
let (s, b) = opt(pair(local, opt(sequence_lvar_port_direction)))(s)?;
|
||||||
@ -740,6 +797,7 @@ pub(crate) fn sequence_port_item(s: Span) -> IResult<Span, SequencePortItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDirection> {
|
pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDirection> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("input"), |x| {
|
map(keyword("input"), |x| {
|
||||||
@ -755,6 +813,7 @@ pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLva
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
|
pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
|
||||||
alt((
|
alt((
|
||||||
map(data_type_or_implicit_sequence_formal_type, |x| {
|
map(data_type_or_implicit_sequence_formal_type, |x| {
|
||||||
@ -770,6 +829,7 @@ pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_sequence_formal_type(
|
pub(crate) fn data_type_or_implicit_sequence_formal_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -785,6 +845,7 @@ pub(crate) fn data_type_or_implicit_sequence_formal_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
alt((
|
alt((
|
||||||
sequence_expr_cycle_delay_expr,
|
sequence_expr_cycle_delay_expr,
|
||||||
@ -803,6 +864,7 @@ pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = cycle_delay_range(s)?;
|
let (s, a) = cycle_delay_range(s)?;
|
||||||
let (s, b) = sequence_expr(s)?;
|
let (s, b) = sequence_expr(s)?;
|
||||||
@ -815,6 +877,7 @@ pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceE
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = cycle_delay_range(s)?;
|
let (s, b) = cycle_delay_range(s)?;
|
||||||
@ -830,6 +893,7 @@ pub(crate) fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, Sequ
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = expression_or_dist(s)?;
|
let (s, a) = expression_or_dist(s)?;
|
||||||
let (s, b) = opt(boolean_abbrev)(s)?;
|
let (s, b) = opt(boolean_abbrev)(s)?;
|
||||||
@ -840,6 +904,7 @@ pub(crate) fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_instance(s)?;
|
let (s, a) = sequence_instance(s)?;
|
||||||
let (s, b) = opt(sequence_abbrev)(s)?;
|
let (s, b) = opt(sequence_abbrev)(s)?;
|
||||||
@ -850,6 +915,7 @@ pub(crate) fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = paren(pair(
|
let (s, a) = paren(pair(
|
||||||
sequence_expr,
|
sequence_expr,
|
||||||
@ -864,6 +930,7 @@ pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = keyword("and")(s)?;
|
let (s, b) = keyword("and")(s)?;
|
||||||
@ -876,6 +943,7 @@ pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = keyword("intersect")(s)?;
|
let (s, b) = keyword("intersect")(s)?;
|
||||||
@ -888,6 +956,7 @@ pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = keyword("or")(s)?;
|
let (s, b) = keyword("or")(s)?;
|
||||||
@ -899,6 +968,7 @@ pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = keyword("first_match")(s)?;
|
let (s, a) = keyword("first_match")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -913,6 +983,7 @@ pub(crate) fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = expression_or_dist(s)?;
|
let (s, a) = expression_or_dist(s)?;
|
||||||
let (s, b) = keyword("throughout")(s)?;
|
let (s, b) = keyword("throughout")(s)?;
|
||||||
@ -925,6 +996,7 @@ pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = sequence_expr(s)?;
|
let (s, a) = sequence_expr(s)?;
|
||||||
let (s, b) = keyword("within")(s)?;
|
let (s, b) = keyword("within")(s)?;
|
||||||
@ -936,6 +1008,7 @@ pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
let (s, a) = clocking_event(s)?;
|
let (s, a) = clocking_event(s)?;
|
||||||
let (s, b) = sequence_expr(s)?;
|
let (s, b) = sequence_expr(s)?;
|
||||||
@ -946,6 +1019,7 @@ pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
|
pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||||
alt((
|
alt((
|
||||||
cycle_delay_range_primary,
|
cycle_delay_range_primary,
|
||||||
@ -956,6 +1030,7 @@ pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
|
pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = constant_primary(s)?;
|
let (s, b) = constant_primary(s)?;
|
||||||
@ -966,6 +1041,7 @@ pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRang
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayRange> {
|
pub(crate) fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = bracket(cycle_delay_const_range_expression)(s)?;
|
let (s, b) = bracket(cycle_delay_const_range_expression)(s)?;
|
||||||
@ -976,6 +1052,7 @@ pub(crate) fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayR
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
|
pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = bracket(symbol("*"))(s)?;
|
let (s, b) = bracket(symbol("*"))(s)?;
|
||||||
@ -986,6 +1063,7 @@ pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRan
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
|
pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
|
||||||
let (s, a) = symbol("##")(s)?;
|
let (s, a) = symbol("##")(s)?;
|
||||||
let (s, b) = bracket(symbol("+"))(s)?;
|
let (s, b) = bracket(symbol("+"))(s)?;
|
||||||
@ -996,6 +1074,7 @@ pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
|
pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
|
||||||
let (s, a) = sequence_instance(s)?;
|
let (s, a) = sequence_instance(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -1004,6 +1083,7 @@ pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
|
pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
|
||||||
alt((
|
alt((
|
||||||
map(operator_assignment, |x| {
|
map(operator_assignment, |x| {
|
||||||
@ -1019,6 +1099,7 @@ pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_instance(s: Span) -> IResult<Span, SequenceInstance> {
|
pub(crate) fn sequence_instance(s: Span) -> IResult<Span, SequenceInstance> {
|
||||||
let (s, a) = ps_or_hierarchical_sequence_identifier(s)?;
|
let (s, a) = ps_or_hierarchical_sequence_identifier(s)?;
|
||||||
let (s, b) = opt(paren(opt(sequence_list_of_arguments)))(s)?;
|
let (s, b) = opt(paren(opt(sequence_list_of_arguments)))(s)?;
|
||||||
@ -1026,6 +1107,7 @@ pub(crate) fn sequence_instance(s: Span) -> IResult<Span, SequenceInstance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListOfArguments> {
|
pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListOfArguments> {
|
||||||
alt((
|
alt((
|
||||||
sequence_list_of_arguments_named,
|
sequence_list_of_arguments_named,
|
||||||
@ -1035,6 +1117,7 @@ pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListO
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_list_of_arguments_ordered(
|
pub(crate) fn sequence_list_of_arguments_ordered(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SequenceListOfArguments> {
|
) -> IResult<Span, SequenceListOfArguments> {
|
||||||
@ -1054,6 +1137,7 @@ pub(crate) fn sequence_list_of_arguments_ordered(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, SequenceListOfArguments> {
|
pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, SequenceListOfArguments> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -1066,6 +1150,7 @@ pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, Sequenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
|
pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
|
||||||
alt((
|
alt((
|
||||||
map(event_expression, |x| {
|
map(event_expression, |x| {
|
||||||
@ -1078,6 +1163,7 @@ pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
|
pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
|
||||||
alt((
|
alt((
|
||||||
map(consecutive_repetition, |x| {
|
map(consecutive_repetition, |x| {
|
||||||
@ -1093,12 +1179,14 @@ pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequence_abbrev(s: Span) -> IResult<Span, SequenceAbbrev> {
|
pub(crate) fn sequence_abbrev(s: Span) -> IResult<Span, SequenceAbbrev> {
|
||||||
let (s, a) = consecutive_repetition(s)?;
|
let (s, a) = consecutive_repetition(s)?;
|
||||||
Ok((s, SequenceAbbrev { nodes: (a,) }))
|
Ok((s, SequenceAbbrev { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
||||||
alt((
|
alt((
|
||||||
consecutive_repetition_expression,
|
consecutive_repetition_expression,
|
||||||
@ -1108,6 +1196,7 @@ pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepeti
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
||||||
let (s, a) = bracket(pair(symbol("*"), const_or_range_expression))(s)?;
|
let (s, a) = bracket(pair(symbol("*"), const_or_range_expression))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -1119,6 +1208,7 @@ pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult<Span, Consec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
||||||
let (s, a) = bracket(symbol("*"))(s)?;
|
let (s, a) = bracket(symbol("*"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -1128,6 +1218,7 @@ pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, Consecut
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetition> {
|
||||||
let (s, a) = bracket(symbol("+"))(s)?;
|
let (s, a) = bracket(symbol("+"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -1137,18 +1228,21 @@ pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveR
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_consecutive_repetition(s: Span) -> IResult<Span, NonConsecutiveRepetition> {
|
pub(crate) fn non_consecutive_repetition(s: Span) -> IResult<Span, NonConsecutiveRepetition> {
|
||||||
let (s, a) = bracket(pair(symbol("="), const_or_range_expression))(s)?;
|
let (s, a) = bracket(pair(symbol("="), const_or_range_expression))(s)?;
|
||||||
Ok((s, NonConsecutiveRepetition { nodes: (a,) }))
|
Ok((s, NonConsecutiveRepetition { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn goto_repetition(s: Span) -> IResult<Span, GotoRepetition> {
|
pub(crate) fn goto_repetition(s: Span) -> IResult<Span, GotoRepetition> {
|
||||||
let (s, a) = bracket(pair(symbol("->"), const_or_range_expression))(s)?;
|
let (s, a) = bracket(pair(symbol("->"), const_or_range_expression))(s)?;
|
||||||
Ok((s, GotoRepetition { nodes: (a,) }))
|
Ok((s, GotoRepetition { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeExpression> {
|
pub(crate) fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(cycle_delay_const_range_expression, |x| {
|
map(cycle_delay_const_range_expression, |x| {
|
||||||
@ -1161,6 +1255,7 @@ pub(crate) fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeEx
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_const_range_expression(
|
pub(crate) fn cycle_delay_const_range_expression(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
||||||
@ -1172,6 +1267,7 @@ pub(crate) fn cycle_delay_const_range_expression(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_const_range_expression_binary(
|
pub(crate) fn cycle_delay_const_range_expression_binary(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
||||||
@ -1188,6 +1284,7 @@ pub(crate) fn cycle_delay_const_range_expression_binary(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cycle_delay_const_range_expression_dollar(
|
pub(crate) fn cycle_delay_const_range_expression_dollar(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
) -> IResult<Span, CycleDelayConstRangeExpression> {
|
||||||
@ -1204,6 +1301,7 @@ pub(crate) fn cycle_delay_const_range_expression_dollar(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression_or_dist(s: Span) -> IResult<Span, ExpressionOrDist> {
|
pub(crate) fn expression_or_dist(s: Span) -> IResult<Span, ExpressionOrDist> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = opt(pair(keyword("dist"), brace(dist_list)))(s)?;
|
let (s, b) = opt(pair(keyword("dist"), brace(dist_list)))(s)?;
|
||||||
@ -1211,6 +1309,7 @@ pub(crate) fn expression_or_dist(s: Span) -> IResult<Span, ExpressionOrDist> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn assertion_variable_declaration(
|
pub(crate) fn assertion_variable_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, AssertionVariableDeclaration> {
|
) -> IResult<Span, AssertionVariableDeclaration> {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
block_item_declaration_data,
|
block_item_declaration_data,
|
||||||
@ -14,6 +15,7 @@ pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclarat
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
pub(crate) fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = data_declaration(s)?;
|
let (s, b) = data_declaration(s)?;
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_item_declaration_local_parameter(
|
pub(crate) fn block_item_declaration_local_parameter(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, BlockItemDeclaration> {
|
) -> IResult<Span, BlockItemDeclaration> {
|
||||||
@ -39,6 +42,7 @@ pub(crate) fn block_item_declaration_local_parameter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_item_declaration_parameter(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
pub(crate) fn block_item_declaration_parameter(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = parameter_declaration(s)?;
|
let (s, b) = parameter_declaration(s)?;
|
||||||
@ -52,6 +56,7 @@ pub(crate) fn block_item_declaration_parameter(s: Span) -> IResult<Span, BlockIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_item_declaration_let(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
pub(crate) fn block_item_declaration_let(s: Span) -> IResult<Span, BlockItemDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = let_declaration(s)?;
|
let (s, b) = let_declaration(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
|
pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
|
||||||
let (s, a) = keyword("covergroup")(s)?;
|
let (s, a) = keyword("covergroup")(s)?;
|
||||||
let (s, b) = covergroup_identifier(s)?;
|
let (s, b) = covergroup_identifier(s)?;
|
||||||
@ -21,11 +22,13 @@ pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclara
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_spec_or_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
pub(crate) fn coverage_spec_or_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
||||||
alt((coverage_spec_or_option_spec, coverage_spec_or_option_option))(s)
|
alt((coverage_spec_or_option_spec, coverage_spec_or_option_option))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_spec_or_option_spec(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
pub(crate) fn coverage_spec_or_option_spec(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = coverage_spec(s)?;
|
let (s, b) = coverage_spec(s)?;
|
||||||
@ -36,6 +39,7 @@ pub(crate) fn coverage_spec_or_option_spec(s: Span) -> IResult<Span, CoverageSpe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
pub(crate) fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = coverage_option(s)?;
|
let (s, b) = coverage_option(s)?;
|
||||||
@ -47,11 +51,13 @@ pub(crate) fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageS
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_option(s: Span) -> IResult<Span, CoverageOption> {
|
pub(crate) fn coverage_option(s: Span) -> IResult<Span, CoverageOption> {
|
||||||
alt((coverage_option_option, coverage_option_type_option))(s)
|
alt((coverage_option_option, coverage_option_type_option))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
|
pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
|
||||||
let (s, a) = keyword("option")(s)?;
|
let (s, a) = keyword("option")(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -67,6 +73,7 @@ pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
|
pub(crate) fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
|
||||||
let (s, a) = keyword("type_option")(s)?;
|
let (s, a) = keyword("type_option")(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -82,6 +89,7 @@ pub(crate) fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOpti
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
|
pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
|
||||||
alt((
|
alt((
|
||||||
map(cover_point, |x| CoverageSpec::CoverPoint(Box::new(x))),
|
map(cover_point, |x| CoverageSpec::CoverPoint(Box::new(x))),
|
||||||
@ -90,6 +98,7 @@ pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
|
pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
|
||||||
alt((
|
alt((
|
||||||
map(clocking_event, |x| {
|
map(clocking_event, |x| {
|
||||||
@ -101,6 +110,7 @@ pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
|
pub(crate) fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
|
||||||
let (s, a) = keyword("with")(s)?;
|
let (s, a) = keyword("with")(s)?;
|
||||||
let (s, b) = keyword("function")(s)?;
|
let (s, b) = keyword("function")(s)?;
|
||||||
@ -115,6 +125,7 @@ pub(crate) fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
|
pub(crate) fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
|
||||||
let (s, a) = symbol("@@")(s)?;
|
let (s, a) = symbol("@@")(s)?;
|
||||||
let (s, b) = paren(block_event_expression)(s)?;
|
let (s, b) = paren(block_event_expression)(s)?;
|
||||||
@ -125,6 +136,7 @@ pub(crate) fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
|
pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
|
||||||
alt((
|
alt((
|
||||||
block_event_expression_or,
|
block_event_expression_or,
|
||||||
@ -135,6 +147,7 @@ pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpress
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpression> {
|
pub(crate) fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpression> {
|
||||||
let (s, a) = block_event_expression(s)?;
|
let (s, a) = block_event_expression(s)?;
|
||||||
let (s, b) = keyword("or")(s)?;
|
let (s, b) = keyword("or")(s)?;
|
||||||
@ -146,6 +159,7 @@ pub(crate) fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventExpression> {
|
pub(crate) fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventExpression> {
|
||||||
let (s, a) = keyword("begin")(s)?;
|
let (s, a) = keyword("begin")(s)?;
|
||||||
let (s, b) = hierarchical_btf_identifier(s)?;
|
let (s, b) = hierarchical_btf_identifier(s)?;
|
||||||
@ -156,6 +170,7 @@ pub(crate) fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExpression> {
|
pub(crate) fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExpression> {
|
||||||
let (s, a) = keyword("end")(s)?;
|
let (s, a) = keyword("end")(s)?;
|
||||||
let (s, b) = hierarchical_btf_identifier(s)?;
|
let (s, b) = hierarchical_btf_identifier(s)?;
|
||||||
@ -166,6 +181,7 @@ pub(crate) fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
|
pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
|
||||||
alt((
|
alt((
|
||||||
map(hierarchical_tf_identifier, |x| {
|
map(hierarchical_tf_identifier, |x| {
|
||||||
@ -179,6 +195,7 @@ pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, Hierarchical
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hierarchical_btf_identifier_method(
|
pub(crate) fn hierarchical_btf_identifier_method(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, HierarchicalBtfIdentifier> {
|
) -> IResult<Span, HierarchicalBtfIdentifier> {
|
||||||
@ -193,6 +210,7 @@ pub(crate) fn hierarchical_btf_identifier_method(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hierarchical_identifier_or_class_scope(
|
pub(crate) fn hierarchical_identifier_or_class_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, HierarchicalIdentifierOrClassScope> {
|
) -> IResult<Span, HierarchicalIdentifierOrClassScope> {
|
||||||
@ -207,6 +225,7 @@ pub(crate) fn hierarchical_identifier_or_class_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
|
pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
|
||||||
let (s, a) = opt(triple(
|
let (s, a) = opt(triple(
|
||||||
opt(data_type_or_implicit_cover_point),
|
opt(data_type_or_implicit_cover_point),
|
||||||
@ -226,6 +245,7 @@ pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_cover_point(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
pub(crate) fn data_type_or_implicit_cover_point(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
alt((
|
alt((
|
||||||
map(terminated(data_type, peek(cover_point_identifier)), |x| {
|
map(terminated(data_type, peek(cover_point_identifier)), |x| {
|
||||||
@ -239,6 +259,7 @@ pub(crate) fn data_type_or_implicit_cover_point(s: Span) -> IResult<Span, DataTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
||||||
alt((
|
alt((
|
||||||
bins_or_empty_non_empty,
|
bins_or_empty_non_empty,
|
||||||
@ -247,6 +268,7 @@ pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
||||||
let (s, a) = brace(pair(
|
let (s, a) = brace(pair(
|
||||||
many0(attribute_instance),
|
many0(attribute_instance),
|
||||||
@ -259,6 +281,7 @@ pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
alt((
|
alt((
|
||||||
map(coverage_option, |x| {
|
map(coverage_option, |x| {
|
||||||
@ -274,6 +297,7 @@ pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = opt(wildcard)(s)?;
|
let (s, a) = opt(wildcard)(s)?;
|
||||||
let (s, b) = bins_keyword(s)?;
|
let (s, b) = bins_keyword(s)?;
|
||||||
@ -292,12 +316,14 @@ pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn wildcard(s: Span) -> IResult<Span, Wildcard> {
|
pub(crate) fn wildcard(s: Span) -> IResult<Span, Wildcard> {
|
||||||
let (s, a) = keyword("wildcard")(s)?;
|
let (s, a) = keyword("wildcard")(s)?;
|
||||||
Ok((s, Wildcard { nodes: (a,) }))
|
Ok((s, Wildcard { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_cover_point(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_cover_point(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = opt(wildcard)(s)?;
|
let (s, a) = opt(wildcard)(s)?;
|
||||||
let (s, b) = bins_keyword(s)?;
|
let (s, b) = bins_keyword(s)?;
|
||||||
@ -317,6 +343,7 @@ pub(crate) fn bins_or_options_cover_point(s: Span) -> IResult<Span, BinsOrOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = opt(wildcard)(s)?;
|
let (s, a) = opt(wildcard)(s)?;
|
||||||
let (s, b) = bins_keyword(s)?;
|
let (s, b) = bins_keyword(s)?;
|
||||||
@ -334,6 +361,7 @@ pub(crate) fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOpt
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = opt(wildcard)(s)?;
|
let (s, a) = opt(wildcard)(s)?;
|
||||||
let (s, b) = bins_keyword(s)?;
|
let (s, b) = bins_keyword(s)?;
|
||||||
@ -351,6 +379,7 @@ pub(crate) fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = bins_keyword(s)?;
|
let (s, a) = bins_keyword(s)?;
|
||||||
let (s, b) = bin_identifier(s)?;
|
let (s, b) = bin_identifier(s)?;
|
||||||
@ -367,6 +396,7 @@ pub(crate) fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrOptions> {
|
pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||||
let (s, a) = bins_keyword(s)?;
|
let (s, a) = bins_keyword(s)?;
|
||||||
let (s, b) = bin_identifier(s)?;
|
let (s, b) = bin_identifier(s)?;
|
||||||
@ -383,6 +413,7 @@ pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrO
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
|
pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("bins"), |x| BinsKeyword::Bins(Box::new(x))),
|
map(keyword("bins"), |x| BinsKeyword::Bins(Box::new(x))),
|
||||||
@ -396,6 +427,7 @@ pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_list(s: Span) -> IResult<Span, TransList> {
|
pub(crate) fn trans_list(s: Span) -> IResult<Span, TransList> {
|
||||||
let (s, a) = list(symbol(","), paren(trans_set))(s)?;
|
let (s, a) = list(symbol(","), paren(trans_set))(s)?;
|
||||||
Ok((s, TransList { nodes: (a,) }))
|
Ok((s, TransList { nodes: (a,) }))
|
||||||
@ -403,12 +435,14 @@ pub(crate) fn trans_list(s: Span) -> IResult<Span, TransList> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_set(s: Span) -> IResult<Span, TransSet> {
|
pub(crate) fn trans_set(s: Span) -> IResult<Span, TransSet> {
|
||||||
let (s, a) = list(symbol("=>"), trans_range_list)(s)?;
|
let (s, a) = list(symbol("=>"), trans_range_list)(s)?;
|
||||||
Ok((s, TransSet { nodes: (a,) }))
|
Ok((s, TransSet { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
|
pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
|
||||||
alt((
|
alt((
|
||||||
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
|
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
|
||||||
@ -420,6 +454,7 @@ pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList> {
|
pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList> {
|
||||||
let (s, a) = trans_item(s)?;
|
let (s, a) = trans_item(s)?;
|
||||||
let (s, b) = bracket(pair(symbol("*"), repeat_range))(s)?;
|
let (s, b) = bracket(pair(symbol("*"), repeat_range))(s)?;
|
||||||
@ -431,6 +466,7 @@ pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
|
pub(crate) fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
|
||||||
let (s, a) = trans_item(s)?;
|
let (s, a) = trans_item(s)?;
|
||||||
let (s, b) = bracket(pair(symbol("->"), repeat_range))(s)?;
|
let (s, b) = bracket(pair(symbol("->"), repeat_range))(s)?;
|
||||||
@ -442,6 +478,7 @@ pub(crate) fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
|
pub(crate) fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
|
||||||
let (s, a) = trans_item(s)?;
|
let (s, a) = trans_item(s)?;
|
||||||
let (s, b) = bracket(pair(symbol("="), repeat_range))(s)?;
|
let (s, b) = bracket(pair(symbol("="), repeat_range))(s)?;
|
||||||
@ -452,12 +489,14 @@ pub(crate) fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn trans_item(s: Span) -> IResult<Span, TransItem> {
|
pub(crate) fn trans_item(s: Span) -> IResult<Span, TransItem> {
|
||||||
let (s, a) = covergroup_range_list(s)?;
|
let (s, a) = covergroup_range_list(s)?;
|
||||||
Ok((s, TransItem { nodes: (a,) }))
|
Ok((s, TransItem { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
|
pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
|
||||||
alt((
|
alt((
|
||||||
map(covergroup_expression, |x| {
|
map(covergroup_expression, |x| {
|
||||||
@ -469,6 +508,7 @@ pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
|
pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
|
||||||
let (s, a) = covergroup_expression(s)?;
|
let (s, a) = covergroup_expression(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -480,6 +520,7 @@ pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
|
pub(crate) fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
|
||||||
let (s, a) = opt(pair(cross_identifier, symbol(":")))(s)?;
|
let (s, a) = opt(pair(cross_identifier, symbol(":")))(s)?;
|
||||||
let (s, b) = keyword("cross")(s)?;
|
let (s, b) = keyword("cross")(s)?;
|
||||||
@ -495,6 +536,7 @@ pub(crate) fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
|
pub(crate) fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
|
||||||
let (s, a) = cross_item(s)?;
|
let (s, a) = cross_item(s)?;
|
||||||
let (s, b) = list(symbol(","), cross_item)(s)?;
|
let (s, b) = list(symbol(","), cross_item)(s)?;
|
||||||
@ -502,6 +544,7 @@ pub(crate) fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cross_item(s: Span) -> IResult<Span, CrossItem> {
|
pub(crate) fn cross_item(s: Span) -> IResult<Span, CrossItem> {
|
||||||
alt((
|
alt((
|
||||||
map(cover_point_identifier, |x| {
|
map(cover_point_identifier, |x| {
|
||||||
@ -514,6 +557,7 @@ pub(crate) fn cross_item(s: Span) -> IResult<Span, CrossItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
|
pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
|
||||||
alt((
|
alt((
|
||||||
cross_body_non_empty,
|
cross_body_non_empty,
|
||||||
@ -522,6 +566,7 @@ pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
|
pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
|
||||||
let (s, a) = brace(many0(pair(cross_body_item, symbol(";"))))(s)?;
|
let (s, a) = brace(many0(pair(cross_body_item, symbol(";"))))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -531,6 +576,7 @@ pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
|
pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
|
||||||
alt((
|
alt((
|
||||||
map(function_declaration, |x| {
|
map(function_declaration, |x| {
|
||||||
@ -543,6 +589,7 @@ pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
||||||
alt((
|
alt((
|
||||||
bins_selection_or_option_coverage,
|
bins_selection_or_option_coverage,
|
||||||
@ -551,6 +598,7 @@ pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
pub(crate) fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = coverage_option(s)?;
|
let (s, b) = coverage_option(s)?;
|
||||||
@ -561,6 +609,7 @@ pub(crate) fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
pub(crate) fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelectionOrOption> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = bins_selection(s)?;
|
let (s, b) = bins_selection(s)?;
|
||||||
@ -571,6 +620,7 @@ pub(crate) fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelect
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
|
pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
|
||||||
let (s, a) = bins_keyword(s)?;
|
let (s, a) = bins_keyword(s)?;
|
||||||
let (s, b) = bin_identifier(s)?;
|
let (s, b) = bin_identifier(s)?;
|
||||||
@ -586,6 +636,7 @@ pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(select_condition, |x| {
|
map(select_condition, |x| {
|
||||||
@ -604,6 +655,7 @@ pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = symbol("!")(s)?;
|
let (s, a) = symbol("!")(s)?;
|
||||||
let (s, b) = select_condition(s)?;
|
let (s, b) = select_condition(s)?;
|
||||||
@ -615,6 +667,7 @@ pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = select_expression(s)?;
|
let (s, a) = select_expression(s)?;
|
||||||
let (s, b) = symbol("&&")(s)?;
|
let (s, b) = symbol("&&")(s)?;
|
||||||
@ -627,6 +680,7 @@ pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = select_expression(s)?;
|
let (s, a) = select_expression(s)?;
|
||||||
let (s, b) = symbol("||")(s)?;
|
let (s, b) = symbol("||")(s)?;
|
||||||
@ -638,6 +692,7 @@ pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = paren(select_expression)(s)?;
|
let (s, a) = paren(select_expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -648,6 +703,7 @@ pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = select_expression(s)?;
|
let (s, a) = select_expression(s)?;
|
||||||
let (s, b) = keyword("with")(s)?;
|
let (s, b) = keyword("with")(s)?;
|
||||||
@ -663,6 +719,7 @@ pub(crate) fn select_expression_with(s: Span) -> IResult<Span, SelectExpression>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpression> {
|
pub(crate) fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpression> {
|
||||||
let (s, a) = cross_set_expression(s)?;
|
let (s, a) = cross_set_expression(s)?;
|
||||||
let (s, b) = opt(pair(keyword("matches"), integer_covergroup_expression))(s)?;
|
let (s, b) = opt(pair(keyword("matches"), integer_covergroup_expression))(s)?;
|
||||||
@ -673,6 +730,7 @@ pub(crate) fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpres
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
|
pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
|
||||||
let (s, a) = keyword("binsof")(s)?;
|
let (s, a) = keyword("binsof")(s)?;
|
||||||
let (s, b) = paren(bins_expression)(s)?;
|
let (s, b) = paren(bins_expression)(s)?;
|
||||||
@ -681,6 +739,7 @@ pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
|
pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(variable_identifier, |x| {
|
map(variable_identifier, |x| {
|
||||||
@ -691,6 +750,7 @@ pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpression> {
|
pub(crate) fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpression> {
|
||||||
let (s, a) = cover_point_identifier(s)?;
|
let (s, a) = cover_point_identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("."), bin_identifier))(s)?;
|
let (s, b) = opt(pair(symbol("."), bin_identifier))(s)?;
|
||||||
@ -702,12 +762,14 @@ pub(crate) fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpressi
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn covergroup_range_list(s: Span) -> IResult<Span, CovergroupRangeList> {
|
pub(crate) fn covergroup_range_list(s: Span) -> IResult<Span, CovergroupRangeList> {
|
||||||
let (s, a) = list(symbol(","), covergroup_value_range)(s)?;
|
let (s, a) = list(symbol(","), covergroup_value_range)(s)?;
|
||||||
Ok((s, CovergroupRangeList { nodes: (a,) }))
|
Ok((s, CovergroupRangeList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRange> {
|
pub(crate) fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRange> {
|
||||||
alt((
|
alt((
|
||||||
map(covergroup_expression, |x| {
|
map(covergroup_expression, |x| {
|
||||||
@ -718,6 +780,7 @@ pub(crate) fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRange> {
|
pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRange> {
|
||||||
let (s, a) = bracket(triple(
|
let (s, a) = bracket(triple(
|
||||||
covergroup_expression,
|
covergroup_expression,
|
||||||
@ -731,30 +794,35 @@ pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, Covergroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn with_covergroup_expression(s: Span) -> IResult<Span, WithCovergroupExpression> {
|
pub(crate) fn with_covergroup_expression(s: Span) -> IResult<Span, WithCovergroupExpression> {
|
||||||
let (s, a) = covergroup_expression(s)?;
|
let (s, a) = covergroup_expression(s)?;
|
||||||
Ok((s, WithCovergroupExpression { nodes: (a,) }))
|
Ok((s, WithCovergroupExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn set_covergroup_expression(s: Span) -> IResult<Span, SetCovergroupExpression> {
|
pub(crate) fn set_covergroup_expression(s: Span) -> IResult<Span, SetCovergroupExpression> {
|
||||||
let (s, a) = covergroup_expression(s)?;
|
let (s, a) = covergroup_expression(s)?;
|
||||||
Ok((s, SetCovergroupExpression { nodes: (a,) }))
|
Ok((s, SetCovergroupExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn integer_covergroup_expression(s: Span) -> IResult<Span, IntegerCovergroupExpression> {
|
pub(crate) fn integer_covergroup_expression(s: Span) -> IResult<Span, IntegerCovergroupExpression> {
|
||||||
let (s, a) = covergroup_expression(s)?;
|
let (s, a) = covergroup_expression(s)?;
|
||||||
Ok((s, IntegerCovergroupExpression { nodes: (a,) }))
|
Ok((s, IntegerCovergroupExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cross_set_expression(s: Span) -> IResult<Span, CrossSetExpression> {
|
pub(crate) fn cross_set_expression(s: Span) -> IResult<Span, CrossSetExpression> {
|
||||||
let (s, a) = covergroup_expression(s)?;
|
let (s, a) = covergroup_expression(s)?;
|
||||||
Ok((s, CrossSetExpression { nodes: (a,) }))
|
Ok((s, CrossSetExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn covergroup_expression(s: Span) -> IResult<Span, CovergroupExpression> {
|
pub(crate) fn covergroup_expression(s: Span) -> IResult<Span, CovergroupExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, CovergroupExpression { nodes: (a,) }))
|
Ok((s, CovergroupExpression { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
|
pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
|
||||||
let (s, a) = hierarchical_parameter_identifier(s)?;
|
let (s, a) = hierarchical_parameter_identifier(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
|
pub(crate) fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
|
||||||
let (s, a) = net_identifier(s)?;
|
let (s, a) = net_identifier(s)?;
|
||||||
let (s, b) = many0(unpacked_dimension)(s)?;
|
let (s, b) = many0(unpacked_dimension)(s)?;
|
||||||
@ -19,6 +21,7 @@ pub(crate) fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
|
pub(crate) fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
|
||||||
let (s, a) = parameter_identifier(s)?;
|
let (s, a) = parameter_identifier(s)?;
|
||||||
let (s, b) = many0(unpacked_dimension)(s)?;
|
let (s, b) = many0(unpacked_dimension)(s)?;
|
||||||
@ -27,6 +30,7 @@ pub(crate) fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
|
pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
|
||||||
alt((
|
alt((
|
||||||
specparam_assignment_mintypmax,
|
specparam_assignment_mintypmax,
|
||||||
@ -37,6 +41,7 @@ pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignment> {
|
pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignment> {
|
||||||
let (s, a) = specparam_identifier(s)?;
|
let (s, a) = specparam_identifier(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -48,6 +53,7 @@ pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, Specparam
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_assignment(s: Span) -> IResult<Span, TypeAssignment> {
|
pub(crate) fn type_assignment(s: Span) -> IResult<Span, TypeAssignment> {
|
||||||
let (s, a) = type_identifier(s)?;
|
let (s, a) = type_identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("="), data_type))(s)?;
|
let (s, b) = opt(pair(symbol("="), data_type))(s)?;
|
||||||
@ -55,6 +61,7 @@ pub(crate) fn type_assignment(s: Span) -> IResult<Span, TypeAssignment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpecparam> {
|
pub(crate) fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpecparam> {
|
||||||
alt((
|
alt((
|
||||||
pulse_control_specparam_without_descriptor,
|
pulse_control_specparam_without_descriptor,
|
||||||
@ -63,6 +70,7 @@ pub(crate) fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulse_control_specparam_without_descriptor(
|
pub(crate) fn pulse_control_specparam_without_descriptor(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PulseControlSpecparam> {
|
) -> IResult<Span, PulseControlSpecparam> {
|
||||||
@ -81,6 +89,7 @@ pub(crate) fn pulse_control_specparam_without_descriptor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulse_control_specparam_with_descriptor(
|
pub(crate) fn pulse_control_specparam_with_descriptor(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PulseControlSpecparam> {
|
) -> IResult<Span, PulseControlSpecparam> {
|
||||||
@ -102,24 +111,28 @@ pub(crate) fn pulse_control_specparam_with_descriptor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn error_limit_value(s: Span) -> IResult<Span, ErrorLimitValue> {
|
pub(crate) fn error_limit_value(s: Span) -> IResult<Span, ErrorLimitValue> {
|
||||||
let (s, a) = limit_value(s)?;
|
let (s, a) = limit_value(s)?;
|
||||||
Ok((s, ErrorLimitValue { nodes: (a,) }))
|
Ok((s, ErrorLimitValue { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn reject_limit_value(s: Span) -> IResult<Span, RejectLimitValue> {
|
pub(crate) fn reject_limit_value(s: Span) -> IResult<Span, RejectLimitValue> {
|
||||||
let (s, a) = limit_value(s)?;
|
let (s, a) = limit_value(s)?;
|
||||||
Ok((s, RejectLimitValue { nodes: (a,) }))
|
Ok((s, RejectLimitValue { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn limit_value(s: Span) -> IResult<Span, LimitValue> {
|
pub(crate) fn limit_value(s: Span) -> IResult<Span, LimitValue> {
|
||||||
let (s, a) = constant_mintypmax_expression(s)?;
|
let (s, a) = constant_mintypmax_expression(s)?;
|
||||||
Ok((s, LimitValue { nodes: (a,) }))
|
Ok((s, LimitValue { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
||||||
alt((
|
alt((
|
||||||
variable_decl_assignment_dynamic_array,
|
variable_decl_assignment_dynamic_array,
|
||||||
@ -129,6 +142,7 @@ pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAss
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_decl_assignment_variable(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
pub(crate) fn variable_decl_assignment_variable(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
||||||
let (s, a) = variable_identifier(s)?;
|
let (s, a) = variable_identifier(s)?;
|
||||||
let (s, b) = many0(variable_dimension)(s)?;
|
let (s, b) = many0(variable_dimension)(s)?;
|
||||||
@ -142,6 +156,7 @@ pub(crate) fn variable_decl_assignment_variable(s: Span) -> IResult<Span, Variab
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_decl_assignment_dynamic_array(
|
pub(crate) fn variable_decl_assignment_dynamic_array(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, VariableDeclAssignment> {
|
) -> IResult<Span, VariableDeclAssignment> {
|
||||||
@ -158,6 +173,7 @@ pub(crate) fn variable_decl_assignment_dynamic_array(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_decl_assignment_class(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
pub(crate) fn variable_decl_assignment_class(s: Span) -> IResult<Span, VariableDeclAssignment> {
|
||||||
let (s, a) = class_variable_identifier(s)?;
|
let (s, a) = class_variable_identifier(s)?;
|
||||||
let (s, b) = pair(symbol("="), class_new)(s)?;
|
let (s, b) = pair(symbol("="), class_new)(s)?;
|
||||||
@ -168,11 +184,13 @@ pub(crate) fn variable_decl_assignment_class(s: Span) -> IResult<Span, VariableD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_new(s: Span) -> IResult<Span, ClassNew> {
|
pub(crate) fn class_new(s: Span) -> IResult<Span, ClassNew> {
|
||||||
alt((class_new_expression, class_new_argument))(s)
|
alt((class_new_expression, class_new_argument))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
|
pub(crate) fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
|
||||||
let (s, a) = opt(class_scope)(s)?;
|
let (s, a) = opt(class_scope)(s)?;
|
||||||
let (s, b) = keyword("new")(s)?;
|
let (s, b) = keyword("new")(s)?;
|
||||||
@ -184,6 +202,7 @@ pub(crate) fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
|
pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
|
||||||
let (s, a) = keyword("new")(s)?;
|
let (s, a) = keyword("new")(s)?;
|
||||||
let (s, b) = expression(s)?;
|
let (s, b) = expression(s)?;
|
||||||
@ -194,6 +213,7 @@ pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dynamic_array_new(s: Span) -> IResult<Span, DynamicArrayNew> {
|
pub(crate) fn dynamic_array_new(s: Span) -> IResult<Span, DynamicArrayNew> {
|
||||||
let (s, a) = keyword("new")(s)?;
|
let (s, a) = keyword("new")(s)?;
|
||||||
let (s, b) = bracket(expression)(s)?;
|
let (s, b) = bracket(expression)(s)?;
|
||||||
|
@ -3,18 +3,21 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_defparam_assignments(s: Span) -> IResult<Span, ListOfDefparamAssignments> {
|
pub(crate) fn list_of_defparam_assignments(s: Span) -> IResult<Span, ListOfDefparamAssignments> {
|
||||||
let (s, a) = list(symbol(","), defparam_assignment)(s)?;
|
let (s, a) = list(symbol(","), defparam_assignment)(s)?;
|
||||||
Ok((s, ListOfDefparamAssignments { nodes: (a,) }))
|
Ok((s, ListOfDefparamAssignments { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_genvar_identifiers(s: Span) -> IResult<Span, ListOfGenvarIdentifiers> {
|
pub(crate) fn list_of_genvar_identifiers(s: Span) -> IResult<Span, ListOfGenvarIdentifiers> {
|
||||||
let (s, a) = list(symbol(","), genvar_identifier)(s)?;
|
let (s, a) = list(symbol(","), genvar_identifier)(s)?;
|
||||||
Ok((s, ListOfGenvarIdentifiers { nodes: (a,) }))
|
Ok((s, ListOfGenvarIdentifiers { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInterfaceIdentifiers> {
|
pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInterfaceIdentifiers> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -24,18 +27,21 @@ pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInte
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_net_decl_assignments(s: Span) -> IResult<Span, ListOfNetDeclAssignments> {
|
pub(crate) fn list_of_net_decl_assignments(s: Span) -> IResult<Span, ListOfNetDeclAssignments> {
|
||||||
let (s, a) = list(symbol(","), net_decl_assignment)(s)?;
|
let (s, a) = list(symbol(","), net_decl_assignment)(s)?;
|
||||||
Ok((s, ListOfNetDeclAssignments { nodes: (a,) }))
|
Ok((s, ListOfNetDeclAssignments { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_param_assignments(s: Span) -> IResult<Span, ListOfParamAssignments> {
|
pub(crate) fn list_of_param_assignments(s: Span) -> IResult<Span, ListOfParamAssignments> {
|
||||||
let (s, a) = list(symbol(","), param_assignment)(s)?;
|
let (s, a) = list(symbol(","), param_assignment)(s)?;
|
||||||
Ok((s, ListOfParamAssignments { nodes: (a,) }))
|
Ok((s, ListOfParamAssignments { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdentifiers> {
|
pub(crate) fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdentifiers> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -45,18 +51,21 @@ pub(crate) fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_udp_port_identifiers(s: Span) -> IResult<Span, ListOfUdpPortIdentifiers> {
|
pub(crate) fn list_of_udp_port_identifiers(s: Span) -> IResult<Span, ListOfUdpPortIdentifiers> {
|
||||||
let (s, a) = list(symbol(","), port_identifier)(s)?;
|
let (s, a) = list(symbol(","), port_identifier)(s)?;
|
||||||
Ok((s, ListOfUdpPortIdentifiers { nodes: (a,) }))
|
Ok((s, ListOfUdpPortIdentifiers { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_specparam_assignments(s: Span) -> IResult<Span, ListOfSpecparamAssignments> {
|
pub(crate) fn list_of_specparam_assignments(s: Span) -> IResult<Span, ListOfSpecparamAssignments> {
|
||||||
let (s, a) = list(symbol(","), specparam_assignment)(s)?;
|
let (s, a) = list(symbol(","), specparam_assignment)(s)?;
|
||||||
Ok((s, ListOfSpecparamAssignments { nodes: (a,) }))
|
Ok((s, ListOfSpecparamAssignments { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_tf_variable_identifiers(
|
pub(crate) fn list_of_tf_variable_identifiers(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfTfVariableIdentifiers> {
|
) -> IResult<Span, ListOfTfVariableIdentifiers> {
|
||||||
@ -72,6 +81,7 @@ pub(crate) fn list_of_tf_variable_identifiers(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_type_assignments(s: Span) -> IResult<Span, ListOfTypeAssignments> {
|
pub(crate) fn list_of_type_assignments(s: Span) -> IResult<Span, ListOfTypeAssignments> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -84,6 +94,7 @@ pub(crate) fn list_of_type_assignments(s: Span) -> IResult<Span, ListOfTypeAssig
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_variable_decl_assignments(
|
pub(crate) fn list_of_variable_decl_assignments(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfVariableDeclAssignments> {
|
) -> IResult<Span, ListOfVariableDeclAssignments> {
|
||||||
@ -92,6 +103,7 @@ pub(crate) fn list_of_variable_decl_assignments(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVariableIdentifiers> {
|
pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVariableIdentifiers> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -101,6 +113,7 @@ pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVaria
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_variable_port_identifiers(
|
pub(crate) fn list_of_variable_port_identifiers(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfVariablePortIdentifiers> {
|
) -> IResult<Span, ListOfVariablePortIdentifiers> {
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unpacked_dimension(s: Span) -> IResult<Span, UnpackedDimension> {
|
pub(crate) fn unpacked_dimension(s: Span) -> IResult<Span, UnpackedDimension> {
|
||||||
alt((unpacked_dimension_range, unpacked_dimension_expression))(s)
|
alt((unpacked_dimension_range, unpacked_dimension_expression))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
|
pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
|
||||||
let (s, a) = bracket(constant_range)(s)?;
|
let (s, a) = bracket(constant_range)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -17,6 +19,7 @@ pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimensi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension> {
|
pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension> {
|
||||||
let (s, a) = bracket(constant_expression)(s)?;
|
let (s, a) = bracket(constant_expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -26,6 +29,7 @@ pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
|
pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
|
||||||
alt((
|
alt((
|
||||||
packed_dimension_range,
|
packed_dimension_range,
|
||||||
@ -36,6 +40,7 @@ pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
|
pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
|
||||||
let (s, a) = bracket(constant_range)(s)?;
|
let (s, a) = bracket(constant_range)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -45,6 +50,7 @@ pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
|
pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
|
||||||
alt((
|
alt((
|
||||||
associative_dimension_data_type,
|
associative_dimension_data_type,
|
||||||
@ -53,6 +59,7 @@ pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimensi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDimension> {
|
pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDimension> {
|
||||||
let (s, a) = bracket(data_type)(s)?;
|
let (s, a) = bracket(data_type)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -62,6 +69,7 @@ pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, Associat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimension> {
|
pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimension> {
|
||||||
let (s, a) = bracket(symbol("*"))(s)?;
|
let (s, a) = bracket(symbol("*"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -71,6 +79,7 @@ pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, Associati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
|
pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
|
||||||
alt((
|
alt((
|
||||||
map(unsized_dimension, |x| {
|
map(unsized_dimension, |x| {
|
||||||
@ -89,6 +98,7 @@ pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
|
pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
|
||||||
let (s, a) = bracket(pair(
|
let (s, a) = bracket(pair(
|
||||||
symbol("$"),
|
symbol("$"),
|
||||||
@ -98,6 +108,7 @@ pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unsized_dimension(s: Span) -> IResult<Span, UnsizedDimension> {
|
pub(crate) fn unsized_dimension(s: Span) -> IResult<Span, UnsizedDimension> {
|
||||||
let (s, a) = symbol("[")(s)?;
|
let (s, a) = symbol("[")(s)?;
|
||||||
let (s, b) = symbol("]")(s)?;
|
let (s, b) = symbol("]")(s)?;
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay3(s: Span) -> IResult<Span, Delay3> {
|
pub(crate) fn delay3(s: Span) -> IResult<Span, Delay3> {
|
||||||
alt((delay3_single, delay3_mintypmax))(s)
|
alt((delay3_single, delay3_mintypmax))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay3_single(s: Span) -> IResult<Span, Delay3> {
|
pub(crate) fn delay3_single(s: Span) -> IResult<Span, Delay3> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = delay_value(s)?;
|
let (s, b) = delay_value(s)?;
|
||||||
@ -15,6 +17,7 @@ pub(crate) fn delay3_single(s: Span) -> IResult<Span, Delay3> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay3_mintypmax(s: Span) -> IResult<Span, Delay3> {
|
pub(crate) fn delay3_mintypmax(s: Span) -> IResult<Span, Delay3> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -32,11 +35,13 @@ pub(crate) fn delay3_mintypmax(s: Span) -> IResult<Span, Delay3> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay2(s: Span) -> IResult<Span, Delay2> {
|
pub(crate) fn delay2(s: Span) -> IResult<Span, Delay2> {
|
||||||
alt((delay2_single, delay2_mintypmax))(s)
|
alt((delay2_single, delay2_mintypmax))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay2_single(s: Span) -> IResult<Span, Delay2> {
|
pub(crate) fn delay2_single(s: Span) -> IResult<Span, Delay2> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = delay_value(s)?;
|
let (s, b) = delay_value(s)?;
|
||||||
@ -44,6 +49,7 @@ pub(crate) fn delay2_single(s: Span) -> IResult<Span, Delay2> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay2_mintypmax(s: Span) -> IResult<Span, Delay2> {
|
pub(crate) fn delay2_mintypmax(s: Span) -> IResult<Span, Delay2> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -57,6 +63,7 @@ pub(crate) fn delay2_mintypmax(s: Span) -> IResult<Span, Delay2> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delay_value(s: Span) -> IResult<Span, DelayValue> {
|
pub(crate) fn delay_value(s: Span) -> IResult<Span, DelayValue> {
|
||||||
alt((
|
alt((
|
||||||
map(unsigned_number, |x| DelayValue::UnsignedNumber(Box::new(x))),
|
map(unsigned_number, |x| DelayValue::UnsignedNumber(Box::new(x))),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataTypeOrImplicit> {
|
pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataTypeOrImplicit> {
|
||||||
alt((
|
alt((
|
||||||
map(
|
map(
|
||||||
@ -29,6 +30,7 @@ pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
|
pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
|
||||||
let (s, a) = keyword("function")(s)?;
|
let (s, a) = keyword("function")(s)?;
|
||||||
let (s, b) = opt(lifetime)(s)?;
|
let (s, b) = opt(lifetime)(s)?;
|
||||||
@ -37,6 +39,7 @@ pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
|
pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
function_body_declaration_without_port,
|
function_body_declaration_without_port,
|
||||||
@ -45,6 +48,7 @@ pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_body_declaration_without_port(
|
pub(crate) fn function_body_declaration_without_port(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, FunctionBodyDeclaration> {
|
) -> IResult<Span, FunctionBodyDeclaration> {
|
||||||
@ -65,6 +69,7 @@ pub(crate) fn function_body_declaration_without_port(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_body_declaration_with_port(
|
pub(crate) fn function_body_declaration_with_port(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, FunctionBodyDeclaration> {
|
) -> IResult<Span, FunctionBodyDeclaration> {
|
||||||
@ -86,6 +91,7 @@ pub(crate) fn function_body_declaration_with_port(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_identifier_or_class_scope(
|
pub(crate) fn interface_identifier_or_class_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, InterfaceIdentifierOrClassScope> {
|
) -> IResult<Span, InterfaceIdentifierOrClassScope> {
|
||||||
@ -100,6 +106,7 @@ pub(crate) fn interface_identifier_or_class_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
|
pub(crate) fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
|
||||||
let (s, a) = keyword("function")(s)?;
|
let (s, a) = keyword("function")(s)?;
|
||||||
let (s, b) = data_type_or_void(s)?;
|
let (s, b) = data_type_or_void(s)?;
|
||||||
@ -114,6 +121,7 @@ pub(crate) fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
|
pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
|
||||||
alt((
|
alt((
|
||||||
dpi_import_export_import_function,
|
dpi_import_export_import_function,
|
||||||
@ -124,6 +132,7 @@ pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImportExport> {
|
pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImportExport> {
|
||||||
let (s, a) = keyword("import")(s)?;
|
let (s, a) = keyword("import")(s)?;
|
||||||
let (s, b) = dpi_spec_string(s)?;
|
let (s, b) = dpi_spec_string(s)?;
|
||||||
@ -140,6 +149,7 @@ pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportExport> {
|
pub(crate) fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportExport> {
|
||||||
let (s, a) = keyword("import")(s)?;
|
let (s, a) = keyword("import")(s)?;
|
||||||
let (s, b) = dpi_spec_string(s)?;
|
let (s, b) = dpi_spec_string(s)?;
|
||||||
@ -156,6 +166,7 @@ pub(crate) fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImportExport> {
|
pub(crate) fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImportExport> {
|
||||||
let (s, a) = keyword("export")(s)?;
|
let (s, a) = keyword("export")(s)?;
|
||||||
let (s, b) = dpi_spec_string(s)?;
|
let (s, b) = dpi_spec_string(s)?;
|
||||||
@ -172,6 +183,7 @@ pub(crate) fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImp
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportExport> {
|
pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportExport> {
|
||||||
let (s, a) = keyword("export")(s)?;
|
let (s, a) = keyword("export")(s)?;
|
||||||
let (s, b) = dpi_spec_string(s)?;
|
let (s, b) = dpi_spec_string(s)?;
|
||||||
@ -188,6 +200,7 @@ pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
|
pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))),
|
map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))),
|
||||||
@ -196,6 +209,7 @@ pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportProperty> {
|
pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportProperty> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("context"), |x| {
|
map(keyword("context"), |x| {
|
||||||
@ -208,18 +222,21 @@ pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunction
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_task_import_property(s: Span) -> IResult<Span, DpiTaskImportProperty> {
|
pub(crate) fn dpi_task_import_property(s: Span) -> IResult<Span, DpiTaskImportProperty> {
|
||||||
let (s, a) = keyword("context")(s)?;
|
let (s, a) = keyword("context")(s)?;
|
||||||
Ok((s, DpiTaskImportProperty::Context(Box::new(a))))
|
Ok((s, DpiTaskImportProperty::Context(Box::new(a))))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_function_proto(s: Span) -> IResult<Span, DpiFunctionProto> {
|
pub(crate) fn dpi_function_proto(s: Span) -> IResult<Span, DpiFunctionProto> {
|
||||||
let (s, a) = function_prototype(s)?;
|
let (s, a) = function_prototype(s)?;
|
||||||
Ok((s, DpiFunctionProto { nodes: (a,) }))
|
Ok((s, DpiFunctionProto { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dpi_task_proto(s: Span) -> IResult<Span, DpiTaskProto> {
|
pub(crate) fn dpi_task_proto(s: Span) -> IResult<Span, DpiTaskProto> {
|
||||||
let (s, a) = task_prototype(s)?;
|
let (s, a) = task_prototype(s)?;
|
||||||
Ok((s, DpiTaskProto { nodes: (a,) }))
|
Ok((s, DpiTaskProto { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
|
pub(crate) fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
|
||||||
let (s, a) = keyword("modport")(s)?;
|
let (s, a) = keyword("modport")(s)?;
|
||||||
let (s, b) = list(symbol(","), modport_item)(s)?;
|
let (s, b) = list(symbol(","), modport_item)(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_item(s: Span) -> IResult<Span, ModportItem> {
|
pub(crate) fn modport_item(s: Span) -> IResult<Span, ModportItem> {
|
||||||
let (s, a) = modport_identifier(s)?;
|
let (s, a) = modport_identifier(s)?;
|
||||||
let (s, b) = paren(list(symbol(","), modport_ports_declaration))(s)?;
|
let (s, b) = paren(list(symbol(","), modport_ports_declaration))(s)?;
|
||||||
@ -18,6 +20,7 @@ pub(crate) fn modport_item(s: Span) -> IResult<Span, ModportItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
pub(crate) fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
||||||
alt((
|
alt((
|
||||||
modport_ports_declaration_simple,
|
modport_ports_declaration_simple,
|
||||||
@ -27,6 +30,7 @@ pub(crate) fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_ports_declaration_simple(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
pub(crate) fn modport_ports_declaration_simple(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = modport_simple_ports_declaration(s)?;
|
let (s, b) = modport_simple_ports_declaration(s)?;
|
||||||
@ -37,6 +41,7 @@ pub(crate) fn modport_ports_declaration_simple(s: Span) -> IResult<Span, Modport
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
pub(crate) fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = modport_tf_ports_declaration(s)?;
|
let (s, b) = modport_tf_ports_declaration(s)?;
|
||||||
@ -47,6 +52,7 @@ pub(crate) fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPort
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
pub(crate) fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = modport_clocking_declaration(s)?;
|
let (s, b) = modport_clocking_declaration(s)?;
|
||||||
@ -59,6 +65,7 @@ pub(crate) fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, Modpo
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_clocking_declaration(s: Span) -> IResult<Span, ModportClockingDeclaration> {
|
pub(crate) fn modport_clocking_declaration(s: Span) -> IResult<Span, ModportClockingDeclaration> {
|
||||||
let (s, a) = keyword("clocking")(s)?;
|
let (s, a) = keyword("clocking")(s)?;
|
||||||
let (s, b) = clocking_identifier(s)?;
|
let (s, b) = clocking_identifier(s)?;
|
||||||
@ -66,6 +73,7 @@ pub(crate) fn modport_clocking_declaration(s: Span) -> IResult<Span, ModportCloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_simple_ports_declaration(
|
pub(crate) fn modport_simple_ports_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModportSimplePortsDeclaration> {
|
) -> IResult<Span, ModportSimplePortsDeclaration> {
|
||||||
@ -75,11 +83,13 @@ pub(crate) fn modport_simple_ports_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_simple_port(s: Span) -> IResult<Span, ModportSimplePort> {
|
pub(crate) fn modport_simple_port(s: Span) -> IResult<Span, ModportSimplePort> {
|
||||||
alt((modport_simple_port_named, modport_simple_port_ordered))(s)
|
alt((modport_simple_port_named, modport_simple_port_ordered))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort> {
|
pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort> {
|
||||||
let (s, a) = port_identifier(s)?;
|
let (s, a) = port_identifier(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -89,6 +99,7 @@ pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
|
pub(crate) fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
|
||||||
let (s, a) = symbol(".")(s)?;
|
let (s, a) = symbol(".")(s)?;
|
||||||
let (s, b) = port_identifier(s)?;
|
let (s, b) = port_identifier(s)?;
|
||||||
@ -100,6 +111,7 @@ pub(crate) fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimpleP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_tf_ports_declaration(s: Span) -> IResult<Span, ModportTfPortsDeclaration> {
|
pub(crate) fn modport_tf_ports_declaration(s: Span) -> IResult<Span, ModportTfPortsDeclaration> {
|
||||||
let (s, a) = import_export(s)?;
|
let (s, a) = import_export(s)?;
|
||||||
let (s, b) = list(symbol(","), modport_tf_port)(s)?;
|
let (s, b) = list(symbol(","), modport_tf_port)(s)?;
|
||||||
@ -107,6 +119,7 @@ pub(crate) fn modport_tf_ports_declaration(s: Span) -> IResult<Span, ModportTfPo
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
|
pub(crate) fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
|
||||||
alt((
|
alt((
|
||||||
map(method_prototype, |x| {
|
map(method_prototype, |x| {
|
||||||
@ -117,6 +130,7 @@ pub(crate) fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn import_export(s: Span) -> IResult<Span, ImportExport> {
|
pub(crate) fn import_export(s: Span) -> IResult<Span, ImportExport> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("import"), |x| ImportExport::Import(Box::new(x))),
|
map(keyword("import"), |x| ImportExport::Import(Box::new(x))),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
|
pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
|
||||||
let (s, a) = keyword("let")(s)?;
|
let (s, a) = keyword("let")(s)?;
|
||||||
let (s, b) = let_identifier(s)?;
|
let (s, b) = let_identifier(s)?;
|
||||||
@ -19,18 +20,21 @@ pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_identifier(s: Span) -> IResult<Span, LetIdentifier> {
|
pub(crate) fn let_identifier(s: Span) -> IResult<Span, LetIdentifier> {
|
||||||
let (s, a) = identifier(s)?;
|
let (s, a) = identifier(s)?;
|
||||||
Ok((s, LetIdentifier { nodes: (a,) }))
|
Ok((s, LetIdentifier { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_port_list(s: Span) -> IResult<Span, LetPortList> {
|
pub(crate) fn let_port_list(s: Span) -> IResult<Span, LetPortList> {
|
||||||
let (s, a) = list(symbol(","), let_port_item)(s)?;
|
let (s, a) = list(symbol(","), let_port_item)(s)?;
|
||||||
Ok((s, LetPortList { nodes: (a,) }))
|
Ok((s, LetPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
|
pub(crate) fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = let_formal_type(s)?;
|
let (s, b) = let_formal_type(s)?;
|
||||||
@ -46,6 +50,7 @@ pub(crate) fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
|
pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
|
||||||
alt((
|
alt((
|
||||||
map(data_type_or_implicit_let_formal_type, |x| {
|
map(data_type_or_implicit_let_formal_type, |x| {
|
||||||
@ -56,6 +61,7 @@ pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_let_formal_type(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
pub(crate) fn data_type_or_implicit_let_formal_type(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
alt((
|
alt((
|
||||||
map(terminated(data_type, peek(formal_port_identifier)), |x| {
|
map(terminated(data_type, peek(formal_port_identifier)), |x| {
|
||||||
@ -69,6 +75,7 @@ pub(crate) fn data_type_or_implicit_let_formal_type(s: Span) -> IResult<Span, Da
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_expression(s: Span) -> IResult<Span, LetExpression> {
|
pub(crate) fn let_expression(s: Span) -> IResult<Span, LetExpression> {
|
||||||
let (s, a) = opt(package_scope)(s)?;
|
let (s, a) = opt(package_scope)(s)?;
|
||||||
let (s, b) = let_identifier(s)?;
|
let (s, b) = let_identifier(s)?;
|
||||||
@ -77,12 +84,14 @@ pub(crate) fn let_expression(s: Span) -> IResult<Span, LetExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_list_of_arguments(s: Span) -> IResult<Span, LetListOfArguments> {
|
pub(crate) fn let_list_of_arguments(s: Span) -> IResult<Span, LetListOfArguments> {
|
||||||
alt((let_list_of_arguments_named, let_list_of_arguments_ordered))(s)
|
alt((let_list_of_arguments_named, let_list_of_arguments_ordered))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_list_of_arguments_ordered(s: Span) -> IResult<Span, LetListOfArguments> {
|
pub(crate) fn let_list_of_arguments_ordered(s: Span) -> IResult<Span, LetListOfArguments> {
|
||||||
let (s, a) = list(symbol(","), opt(let_actual_arg))(s)?;
|
let (s, a) = list(symbol(","), opt(let_actual_arg))(s)?;
|
||||||
let (s, b) = many0(tuple((
|
let (s, b) = many0(tuple((
|
||||||
@ -98,6 +107,7 @@ pub(crate) fn let_list_of_arguments_ordered(s: Span) -> IResult<Span, LetListOfA
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments> {
|
pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments> {
|
||||||
let (s, a) = list(
|
let (s, a) = list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -110,6 +120,7 @@ pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArg
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn let_actual_arg(s: Span) -> IResult<Span, LetActualArg> {
|
pub(crate) fn let_actual_arg(s: Span) -> IResult<Span, LetActualArg> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, LetActualArg { nodes: (a,) }))
|
Ok((s, LetActualArg { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDeclaration> {
|
pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
local_parameter_declaration_param,
|
local_parameter_declaration_param,
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParamet
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn local_parameter_declaration_param(
|
pub(crate) fn local_parameter_declaration_param(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, LocalParameterDeclaration> {
|
) -> IResult<Span, LocalParameterDeclaration> {
|
||||||
@ -26,6 +28,7 @@ pub(crate) fn local_parameter_declaration_param(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_local_parameter_declaration_param(
|
pub(crate) fn data_type_or_implicit_local_parameter_declaration_param(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -41,6 +44,7 @@ pub(crate) fn data_type_or_implicit_local_parameter_declaration_param(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn local_parameter_declaration_type(
|
pub(crate) fn local_parameter_declaration_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, LocalParameterDeclaration> {
|
) -> IResult<Span, LocalParameterDeclaration> {
|
||||||
@ -56,11 +60,13 @@ pub(crate) fn local_parameter_declaration_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclaration> {
|
pub(crate) fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclaration> {
|
||||||
alt((parameter_declaration_param, parameter_declaration_type))(s)
|
alt((parameter_declaration_param, parameter_declaration_type))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDeclaration> {
|
pub(crate) fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDeclaration> {
|
||||||
let (s, a) = keyword("parameter")(s)?;
|
let (s, a) = keyword("parameter")(s)?;
|
||||||
let (s, b) = data_type_or_implicit_parameter_declaration_param(s)?;
|
let (s, b) = data_type_or_implicit_parameter_declaration_param(s)?;
|
||||||
@ -72,6 +78,7 @@ pub(crate) fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_parameter_declaration_param(
|
pub(crate) fn data_type_or_implicit_parameter_declaration_param(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -87,6 +94,7 @@ pub(crate) fn data_type_or_implicit_parameter_declaration_param(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration> {
|
pub(crate) fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration> {
|
||||||
let (s, a) = keyword("parameter")(s)?;
|
let (s, a) = keyword("parameter")(s)?;
|
||||||
let (s, b) = keyword("type")(s)?;
|
let (s, b) = keyword("type")(s)?;
|
||||||
@ -98,6 +106,7 @@ pub(crate) fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specparam_declaration(s: Span) -> IResult<Span, SpecparamDeclaration> {
|
pub(crate) fn specparam_declaration(s: Span) -> IResult<Span, SpecparamDeclaration> {
|
||||||
let (s, a) = keyword("specparam")(s)?;
|
let (s, a) = keyword("specparam")(s)?;
|
||||||
let (s, b) = opt(packed_dimension)(s)?;
|
let (s, b) = opt(packed_dimension)(s)?;
|
||||||
|
@ -5,6 +5,7 @@ use crate::*;
|
|||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[packrat_parser]
|
#[packrat_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
|
pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
|
||||||
alt((
|
alt((
|
||||||
map(simple_type, |x| CastingType::SimpleType(Box::new(x))),
|
map(simple_type, |x| CastingType::SimpleType(Box::new(x))),
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
|
||||||
alt((
|
alt((
|
||||||
data_type_vector,
|
data_type_vector,
|
||||||
@ -41,6 +43,7 @@ pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_vector(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_vector(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = integer_vector_type(s)?;
|
let (s, a) = integer_vector_type(s)?;
|
||||||
let (s, b) = opt(signing)(s)?;
|
let (s, b) = opt(signing)(s)?;
|
||||||
@ -52,6 +55,7 @@ pub(crate) fn data_type_vector(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_atom(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_atom(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = integer_atom_type(s)?;
|
let (s, a) = integer_atom_type(s)?;
|
||||||
let (s, b) = opt(signing)(s)?;
|
let (s, b) = opt(signing)(s)?;
|
||||||
@ -59,6 +63,7 @@ pub(crate) fn data_type_atom(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_struct_union(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_struct_union(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = struct_union(s)?;
|
let (s, a) = struct_union(s)?;
|
||||||
let (s, b) = opt(pair(packed, opt(signing)))(s)?;
|
let (s, b) = opt(pair(packed, opt(signing)))(s)?;
|
||||||
@ -73,12 +78,14 @@ pub(crate) fn data_type_struct_union(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn packed(s: Span) -> IResult<Span, Packed> {
|
pub(crate) fn packed(s: Span) -> IResult<Span, Packed> {
|
||||||
let (s, a) = keyword("packed")(s)?;
|
let (s, a) = keyword("packed")(s)?;
|
||||||
Ok((s, Packed { nodes: (a,) }))
|
Ok((s, Packed { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_enum(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_enum(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = keyword("enum")(s)?;
|
let (s, a) = keyword("enum")(s)?;
|
||||||
let (s, b) = opt(enum_base_type)(s)?;
|
let (s, b) = opt(enum_base_type)(s)?;
|
||||||
@ -93,6 +100,7 @@ pub(crate) fn data_type_enum(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = keyword("virtual")(s)?;
|
let (s, a) = keyword("virtual")(s)?;
|
||||||
let (s, b) = opt(interface)(s)?;
|
let (s, b) = opt(interface)(s)?;
|
||||||
@ -108,12 +116,14 @@ pub(crate) fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface(s: Span) -> IResult<Span, Interface> {
|
pub(crate) fn interface(s: Span) -> IResult<Span, Interface> {
|
||||||
let (s, a) = keyword("interface")(s)?;
|
let (s, a) = keyword("interface")(s)?;
|
||||||
Ok((s, Interface { nodes: (a,) }))
|
Ok((s, Interface { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_type(s: Span) -> IResult<Span, DataType> {
|
pub(crate) fn data_type_type(s: Span) -> IResult<Span, DataType> {
|
||||||
let (s, a) = opt(package_scope_or_class_scope)(s)?;
|
let (s, a) = opt(package_scope_or_class_scope)(s)?;
|
||||||
let (s, b) = type_identifier(s)?;
|
let (s, b) = type_identifier(s)?;
|
||||||
@ -127,6 +137,7 @@ pub(crate) fn data_type_type(s: Span) -> IResult<Span, DataType> {
|
|||||||
// all data_type_or_implicit call are specialized for each parser
|
// all data_type_or_implicit call are specialized for each parser
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
alt((
|
alt((
|
||||||
map(data_type, |x| DataTypeOrImplicit::DataType(Box::new(x))),
|
map(data_type, |x| DataTypeOrImplicit::DataType(Box::new(x))),
|
||||||
@ -137,6 +148,7 @@ pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn implicit_data_type(s: Span) -> IResult<Span, ImplicitDataType> {
|
pub(crate) fn implicit_data_type(s: Span) -> IResult<Span, ImplicitDataType> {
|
||||||
let (s, a) = opt(signing)(s)?;
|
let (s, a) = opt(signing)(s)?;
|
||||||
let (s, b) = many0(packed_dimension)(s)?;
|
let (s, b) = many0(packed_dimension)(s)?;
|
||||||
@ -144,6 +156,7 @@ pub(crate) fn implicit_data_type(s: Span) -> IResult<Span, ImplicitDataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
|
pub(crate) fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
|
||||||
alt((
|
alt((
|
||||||
enum_base_type_atom,
|
enum_base_type_atom,
|
||||||
@ -153,6 +166,7 @@ pub(crate) fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
|
pub(crate) fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
|
||||||
let (s, a) = integer_atom_type(s)?;
|
let (s, a) = integer_atom_type(s)?;
|
||||||
let (s, b) = opt(signing)(s)?;
|
let (s, b) = opt(signing)(s)?;
|
||||||
@ -163,6 +177,7 @@ pub(crate) fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
|
pub(crate) fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
|
||||||
let (s, a) = integer_vector_type(s)?;
|
let (s, a) = integer_vector_type(s)?;
|
||||||
let (s, b) = opt(signing)(s)?;
|
let (s, b) = opt(signing)(s)?;
|
||||||
@ -174,6 +189,7 @@ pub(crate) fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
|
pub(crate) fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
|
||||||
let (s, a) = type_identifier(s)?;
|
let (s, a) = type_identifier(s)?;
|
||||||
let (s, b) = opt(packed_dimension)(s)?;
|
let (s, b) = opt(packed_dimension)(s)?;
|
||||||
@ -184,6 +200,7 @@ pub(crate) fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
|
pub(crate) fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
|
||||||
let (s, a) = enum_identifier(s)?;
|
let (s, a) = enum_identifier(s)?;
|
||||||
let (s, b) = opt(bracket(pair(
|
let (s, b) = opt(bracket(pair(
|
||||||
@ -196,6 +213,7 @@ pub(crate) fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaratio
|
|||||||
|
|
||||||
#[packrat_parser]
|
#[packrat_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_scope(s: Span) -> IResult<Span, ClassScope> {
|
pub(crate) fn class_scope(s: Span) -> IResult<Span, ClassScope> {
|
||||||
let (s, a) = class_type(s)?;
|
let (s, a) = class_type(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
@ -203,6 +221,7 @@ pub(crate) fn class_scope(s: Span) -> IResult<Span, ClassScope> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_type(s: Span) -> IResult<Span, ClassType> {
|
pub(crate) fn class_type(s: Span) -> IResult<Span, ClassType> {
|
||||||
let (s, a) = ps_class_identifier(s)?;
|
let (s, a) = ps_class_identifier(s)?;
|
||||||
let (s, b) = opt(parameter_value_assignment)(s)?;
|
let (s, b) = opt(parameter_value_assignment)(s)?;
|
||||||
@ -215,6 +234,7 @@ pub(crate) fn class_type(s: Span) -> IResult<Span, ClassType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
|
pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
|
||||||
alt((
|
alt((
|
||||||
map(integer_vector_type, |x| {
|
map(integer_vector_type, |x| {
|
||||||
@ -227,6 +247,7 @@ pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
|
pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("byte"), |x| IntegerAtomType::Byte(Box::new(x))),
|
map(keyword("byte"), |x| IntegerAtomType::Byte(Box::new(x))),
|
||||||
@ -245,6 +266,7 @@ pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
|
pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("bit"), |x| IntegerVectorType::Bit(Box::new(x))),
|
map(keyword("bit"), |x| IntegerVectorType::Bit(Box::new(x))),
|
||||||
@ -254,6 +276,7 @@ pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
|
pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("shortreal"), |x| {
|
map(keyword("shortreal"), |x| {
|
||||||
@ -267,6 +290,7 @@ pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
|
pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("supply0"), |x| NetType::Supply0(Box::new(x))),
|
map(keyword("supply0"), |x| NetType::Supply0(Box::new(x))),
|
||||||
@ -285,6 +309,7 @@ pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
|
pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
|
||||||
alt((
|
alt((
|
||||||
net_port_type_data_type,
|
net_port_type_data_type,
|
||||||
@ -296,6 +321,7 @@ pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
|
pub(crate) fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
|
||||||
let (s, a) = opt(net_type)(s)?;
|
let (s, a) = opt(net_type)(s)?;
|
||||||
let (s, b) = data_type_or_implicit_net_port_type_data_type(s)?;
|
let (s, b) = data_type_or_implicit_net_port_type_data_type(s)?;
|
||||||
@ -306,6 +332,7 @@ pub(crate) fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_net_port_type_data_type(
|
pub(crate) fn data_type_or_implicit_net_port_type_data_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -320,6 +347,7 @@ pub(crate) fn data_type_or_implicit_net_port_type_data_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType> {
|
pub(crate) fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType> {
|
||||||
let (s, a) = keyword("interconnect")(s)?;
|
let (s, a) = keyword("interconnect")(s)?;
|
||||||
let (s, b) = implicit_data_type(s)?;
|
let (s, b) = implicit_data_type(s)?;
|
||||||
@ -330,12 +358,14 @@ pub(crate) fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
|
pub(crate) fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
|
||||||
let (s, a) = var_data_type(s)?;
|
let (s, a) = var_data_type(s)?;
|
||||||
Ok((s, VariablePortType { nodes: (a,) }))
|
Ok((s, VariablePortType { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
|
pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
|
||||||
alt((
|
alt((
|
||||||
map(terminated(data_type, peek(variable_identifier)), |x| {
|
map(terminated(data_type, peek(variable_identifier)), |x| {
|
||||||
@ -346,6 +376,7 @@ pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
|
pub(crate) fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
|
||||||
let (s, a) = keyword("var")(s)?;
|
let (s, a) = keyword("var")(s)?;
|
||||||
let (s, b) = data_type_or_implicit_var_data_type_var(s)?;
|
let (s, b) = data_type_or_implicit_var_data_type_var(s)?;
|
||||||
@ -356,6 +387,7 @@ pub(crate) fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_var_data_type_var(
|
pub(crate) fn data_type_or_implicit_var_data_type_var(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -371,6 +403,7 @@ pub(crate) fn data_type_or_implicit_var_data_type_var(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
|
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("signed"), |x| Signing::Signed(Box::new(x))),
|
map(keyword("signed"), |x| Signing::Signed(Box::new(x))),
|
||||||
@ -380,6 +413,7 @@ pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
|
|||||||
|
|
||||||
#[packrat_parser]
|
#[packrat_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
|
pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
|
||||||
alt((
|
alt((
|
||||||
map(integer_type, |x| SimpleType::IntegerType(Box::new(x))),
|
map(integer_type, |x| SimpleType::IntegerType(Box::new(x))),
|
||||||
@ -396,6 +430,7 @@ pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
|
pub(crate) fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = opt(random_qualifier)(s)?;
|
let (s, b) = opt(random_qualifier)(s)?;
|
||||||
@ -411,6 +446,7 @@ pub(crate) fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
|
pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
|
||||||
alt((
|
alt((
|
||||||
map(data_type, |x| DataTypeOrVoid::DataType(Box::new(x))),
|
map(data_type, |x| DataTypeOrVoid::DataType(Box::new(x))),
|
||||||
@ -419,6 +455,7 @@ pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
|
pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("struct"), |x| StructUnion::Struct(Box::new(x))),
|
map(keyword("struct"), |x| StructUnion::Struct(Box::new(x))),
|
||||||
@ -430,11 +467,13 @@ pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_reference(s: Span) -> IResult<Span, TypeReference> {
|
pub(crate) fn type_reference(s: Span) -> IResult<Span, TypeReference> {
|
||||||
alt((type_reference_expression, type_reference_data_type))(s)
|
alt((type_reference_expression, type_reference_data_type))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
|
pub(crate) fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
|
||||||
let (s, a) = keyword("type")(s)?;
|
let (s, a) = keyword("type")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -445,6 +484,7 @@ pub(crate) fn type_reference_expression(s: Span) -> IResult<Span, TypeReference>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_reference_data_type(s: Span) -> IResult<Span, TypeReference> {
|
pub(crate) fn type_reference_data_type(s: Span) -> IResult<Span, TypeReference> {
|
||||||
let (s, a) = keyword("type")(s)?;
|
let (s, a) = keyword("type")(s)?;
|
||||||
let (s, b) = paren(data_type)(s)?;
|
let (s, b) = paren(data_type)(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
|
pub(crate) fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
|
||||||
let (s, a) = keyword("inout")(s)?;
|
let (s, a) = keyword("inout")(s)?;
|
||||||
let (s, b) = net_port_type(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
@ -11,11 +12,13 @@ pub(crate) fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_declaration(s: Span) -> IResult<Span, InputDeclaration> {
|
pub(crate) fn input_declaration(s: Span) -> IResult<Span, InputDeclaration> {
|
||||||
alt((input_declaration_net, input_declaration_variable))(s)
|
alt((input_declaration_net, input_declaration_variable))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration> {
|
pub(crate) fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = net_port_type(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
@ -27,6 +30,7 @@ pub(crate) fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclaration> {
|
pub(crate) fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclaration> {
|
||||||
let (s, a) = keyword("input")(s)?;
|
let (s, a) = keyword("input")(s)?;
|
||||||
let (s, b) = variable_port_type(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
@ -38,11 +42,13 @@ pub(crate) fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclarat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_declaration(s: Span) -> IResult<Span, OutputDeclaration> {
|
pub(crate) fn output_declaration(s: Span) -> IResult<Span, OutputDeclaration> {
|
||||||
alt((output_declaration_net, output_declaration_variable))(s)
|
alt((output_declaration_net, output_declaration_variable))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration> {
|
pub(crate) fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration> {
|
||||||
let (s, a) = keyword("output")(s)?;
|
let (s, a) = keyword("output")(s)?;
|
||||||
let (s, b) = net_port_type(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
@ -54,6 +60,7 @@ pub(crate) fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclaration> {
|
pub(crate) fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclaration> {
|
||||||
let (s, a) = keyword("output")(s)?;
|
let (s, a) = keyword("output")(s)?;
|
||||||
let (s, b) = variable_port_type(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
@ -65,6 +72,7 @@ pub(crate) fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePortDeclaration> {
|
pub(crate) fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePortDeclaration> {
|
||||||
let (s, a) = interface_identifier(s)?;
|
let (s, a) = interface_identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
||||||
@ -73,6 +81,7 @@ pub(crate) fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePort
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ref_declaration(s: Span) -> IResult<Span, RefDeclaration> {
|
pub(crate) fn ref_declaration(s: Span) -> IResult<Span, RefDeclaration> {
|
||||||
let (s, a) = keyword("ref")(s)?;
|
let (s, a) = keyword("ref")(s)?;
|
||||||
let (s, b) = variable_port_type(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
alt((
|
alt((
|
||||||
drive_strength01,
|
drive_strength01,
|
||||||
@ -15,6 +16,7 @@ pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -33,6 +36,7 @@ pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(strength0, symbol(","), keyword("highz1")))(s)?;
|
let (s, a) = paren(triple(strength0, symbol(","), keyword("highz1")))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -42,6 +46,7 @@ pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(strength1, symbol(","), keyword("highz0")))(s)?;
|
let (s, a) = paren(triple(strength1, symbol(","), keyword("highz0")))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -51,6 +56,7 @@ pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(keyword("highz0"), symbol(","), strength1))(s)?;
|
let (s, a) = paren(triple(keyword("highz0"), symbol(","), strength1))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -60,6 +66,7 @@ pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
|
pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
|
||||||
let (s, a) = paren(triple(keyword("highz1"), symbol(","), strength0))(s)?;
|
let (s, a) = paren(triple(keyword("highz1"), symbol(","), strength0))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -69,6 +76,7 @@ pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
|
pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("supply0"), |x| Strength0::Supply0(Box::new(x))),
|
map(keyword("supply0"), |x| Strength0::Supply0(Box::new(x))),
|
||||||
@ -79,6 +87,7 @@ pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
|
pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("supply1"), |x| Strength1::Supply1(Box::new(x))),
|
map(keyword("supply1"), |x| Strength1::Supply1(Box::new(x))),
|
||||||
@ -89,6 +98,7 @@ pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
|
pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
|
||||||
alt((
|
alt((
|
||||||
charge_strength_small,
|
charge_strength_small,
|
||||||
@ -98,6 +108,7 @@ pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
|
pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
|
||||||
let (s, a) = paren(keyword("small"))(s)?;
|
let (s, a) = paren(keyword("small"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -107,6 +118,7 @@ pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
|
pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
|
||||||
let (s, a) = paren(keyword("medium"))(s)?;
|
let (s, a) = paren(keyword("medium"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -116,6 +128,7 @@ pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn charge_strength_large(s: Span) -> IResult<Span, ChargeStrength> {
|
pub(crate) fn charge_strength_large(s: Span) -> IResult<Span, ChargeStrength> {
|
||||||
let (s, a) = paren(keyword("large"))(s)?;
|
let (s, a) = paren(keyword("large"))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
|
pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
|
||||||
let (s, a) = keyword("task")(s)?;
|
let (s, a) = keyword("task")(s)?;
|
||||||
let (s, b) = opt(lifetime)(s)?;
|
let (s, b) = opt(lifetime)(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
task_body_declaration_without_port,
|
task_body_declaration_without_port,
|
||||||
@ -19,6 +21,7 @@ pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
pub(crate) fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
||||||
let (s, a) = opt(interface_identifier_or_class_scope)(s)?;
|
let (s, a) = opt(interface_identifier_or_class_scope)(s)?;
|
||||||
let (s, b) = task_identifier(s)?;
|
let (s, b) = task_identifier(s)?;
|
||||||
@ -36,6 +39,7 @@ pub(crate) fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskB
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
pub(crate) fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
|
||||||
let (s, a) = opt(interface_identifier_or_class_scope)(s)?;
|
let (s, a) = opt(interface_identifier_or_class_scope)(s)?;
|
||||||
let (s, b) = task_identifier(s)?;
|
let (s, b) = task_identifier(s)?;
|
||||||
@ -54,6 +58,7 @@ pub(crate) fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBody
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
|
pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
map(block_item_declaration, |x| {
|
map(block_item_declaration, |x| {
|
||||||
@ -66,12 +71,14 @@ pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_port_list(s: Span) -> IResult<Span, TfPortList> {
|
pub(crate) fn tf_port_list(s: Span) -> IResult<Span, TfPortList> {
|
||||||
let (s, a) = list(symbol(","), tf_port_item)(s)?;
|
let (s, a) = list(symbol(","), tf_port_item)(s)?;
|
||||||
Ok((s, TfPortList { nodes: (a,) }))
|
Ok((s, TfPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
|
pub(crate) fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = opt(tf_port_direction)(s)?;
|
let (s, b) = opt(tf_port_direction)(s)?;
|
||||||
@ -91,6 +98,7 @@ pub(crate) fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_tf_port_item(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
pub(crate) fn data_type_or_implicit_tf_port_item(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
alt((
|
alt((
|
||||||
map(
|
map(
|
||||||
@ -125,6 +133,7 @@ pub(crate) fn data_type_or_implicit_tf_port_item(s: Span) -> IResult<Span, DataT
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
|
pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
|
||||||
alt((
|
alt((
|
||||||
map(port_direction, |x| {
|
map(port_direction, |x| {
|
||||||
@ -137,6 +146,7 @@ pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
|
pub(crate) fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = tf_port_direction(s)?;
|
let (s, b) = tf_port_direction(s)?;
|
||||||
@ -153,6 +163,7 @@ pub(crate) fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_tf_port_declaration(
|
pub(crate) fn data_type_or_implicit_tf_port_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -168,6 +179,7 @@ pub(crate) fn data_type_or_implicit_tf_port_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn task_prototype(s: Span) -> IResult<Span, TaskPrototype> {
|
pub(crate) fn task_prototype(s: Span) -> IResult<Span, TaskPrototype> {
|
||||||
let (s, a) = keyword("task")(s)?;
|
let (s, a) = keyword("task")(s)?;
|
||||||
let (s, b) = task_identifier(s)?;
|
let (s, b) = task_identifier(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
|
pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
data_declaration_variable,
|
data_declaration_variable,
|
||||||
@ -19,6 +20,7 @@ pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
|
pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
|
||||||
let (s, a) = opt(r#const)(s)?;
|
let (s, a) = opt(r#const)(s)?;
|
||||||
let (s, b) = opt(var)(s)?;
|
let (s, b) = opt(var)(s)?;
|
||||||
@ -35,6 +37,7 @@ pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_data_declaration_variable(
|
pub(crate) fn data_type_or_implicit_data_declaration_variable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -50,12 +53,14 @@ pub(crate) fn data_type_or_implicit_data_declaration_variable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn r#const(s: Span) -> IResult<Span, Const> {
|
pub(crate) fn r#const(s: Span) -> IResult<Span, Const> {
|
||||||
let (s, a) = keyword("const")(s)?;
|
let (s, a) = keyword("const")(s)?;
|
||||||
Ok((s, Const { nodes: (a,) }))
|
Ok((s, Const { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_import_declaration(s: Span) -> IResult<Span, PackageImportDeclaration> {
|
pub(crate) fn package_import_declaration(s: Span) -> IResult<Span, PackageImportDeclaration> {
|
||||||
let (s, a) = keyword("import")(s)?;
|
let (s, a) = keyword("import")(s)?;
|
||||||
let (s, b) = list(symbol(","), package_import_item)(s)?;
|
let (s, b) = list(symbol(","), package_import_item)(s)?;
|
||||||
@ -64,11 +69,13 @@ pub(crate) fn package_import_declaration(s: Span) -> IResult<Span, PackageImport
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_import_item(s: Span) -> IResult<Span, PackageImportItem> {
|
pub(crate) fn package_import_item(s: Span) -> IResult<Span, PackageImportItem> {
|
||||||
alt((package_import_item_identifier, package_import_item_asterisk))(s)
|
alt((package_import_item_identifier, package_import_item_asterisk))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportItem> {
|
pub(crate) fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportItem> {
|
||||||
let (s, a) = package_identifier(s)?;
|
let (s, a) = package_identifier(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
@ -80,6 +87,7 @@ pub(crate) fn package_import_item_identifier(s: Span) -> IResult<Span, PackageIm
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem> {
|
pub(crate) fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem> {
|
||||||
let (s, a) = package_identifier(s)?;
|
let (s, a) = package_identifier(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
@ -91,6 +99,7 @@ pub(crate) fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImpo
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclaration> {
|
pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
package_export_declaration_asterisk,
|
package_export_declaration_asterisk,
|
||||||
@ -99,6 +108,7 @@ pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_export_declaration_asterisk(
|
pub(crate) fn package_export_declaration_asterisk(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PackageExportDeclaration> {
|
) -> IResult<Span, PackageExportDeclaration> {
|
||||||
@ -114,6 +124,7 @@ pub(crate) fn package_export_declaration_asterisk(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_export_declaration_item(s: Span) -> IResult<Span, PackageExportDeclaration> {
|
pub(crate) fn package_export_declaration_item(s: Span) -> IResult<Span, PackageExportDeclaration> {
|
||||||
let (s, a) = keyword("export")(s)?;
|
let (s, a) = keyword("export")(s)?;
|
||||||
let (s, b) = list(symbol(","), package_import_item)(s)?;
|
let (s, b) = list(symbol(","), package_import_item)(s)?;
|
||||||
@ -125,6 +136,7 @@ pub(crate) fn package_export_declaration_item(s: Span) -> IResult<Span, PackageE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
|
pub(crate) fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
|
||||||
let (s, a) = keyword("genvar")(s)?;
|
let (s, a) = keyword("genvar")(s)?;
|
||||||
let (s, b) = list_of_genvar_identifiers(s)?;
|
let (s, b) = list_of_genvar_identifiers(s)?;
|
||||||
@ -133,6 +145,7 @@ pub(crate) fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
|
pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
net_declaration_interconnect,
|
net_declaration_interconnect,
|
||||||
@ -142,6 +155,7 @@ pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
|
pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
|
||||||
let (s, a) = net_type(s)?;
|
let (s, a) = net_type(s)?;
|
||||||
let (s, b) = opt(strength)(s)?;
|
let (s, b) = opt(strength)(s)?;
|
||||||
@ -159,6 +173,7 @@ pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_type_or_implicit_net_declaration_net_type(
|
pub(crate) fn data_type_or_implicit_net_declaration_net_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, DataTypeOrImplicit> {
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
@ -178,6 +193,7 @@ pub(crate) fn data_type_or_implicit_net_declaration_net_type(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
|
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
|
||||||
alt((
|
alt((
|
||||||
map(drive_strength, |x| Strength::Drive(Box::new(x))),
|
map(drive_strength, |x| Strength::Drive(Box::new(x))),
|
||||||
@ -186,6 +202,7 @@ pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
|
pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("vectored"), |x| VectorScalar::Vectored(Box::new(x))),
|
map(keyword("vectored"), |x| VectorScalar::Vectored(Box::new(x))),
|
||||||
@ -194,6 +211,7 @@ pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetDeclaration> {
|
pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetDeclaration> {
|
||||||
let (s, a) = net_type_identifier(s)?;
|
let (s, a) = net_type_identifier(s)?;
|
||||||
let (s, b) = opt(delay_control)(s)?;
|
let (s, b) = opt(delay_control)(s)?;
|
||||||
@ -208,6 +226,7 @@ pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
|
pub(crate) fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
|
||||||
let (s, a) = keyword("interconnect")(s)?;
|
let (s, a) = keyword("interconnect")(s)?;
|
||||||
let (s, b) = implicit_data_type(s)?;
|
let (s, b) = implicit_data_type(s)?;
|
||||||
@ -229,6 +248,7 @@ pub(crate) fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclarat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
|
pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
type_declaration_data_type,
|
type_declaration_data_type,
|
||||||
@ -238,6 +258,7 @@ pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
|
pub(crate) fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
|
||||||
let (s, a) = keyword("typedef")(s)?;
|
let (s, a) = keyword("typedef")(s)?;
|
||||||
let (s, b) = data_type(s)?;
|
let (s, b) = data_type(s)?;
|
||||||
@ -253,6 +274,7 @@ pub(crate) fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
|
pub(crate) fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
|
||||||
let (s, a) = keyword("typedef")(s)?;
|
let (s, a) = keyword("typedef")(s)?;
|
||||||
let (s, b) = interface_instance_identifier(s)?;
|
let (s, b) = interface_instance_identifier(s)?;
|
||||||
@ -270,6 +292,7 @@ pub(crate) fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaration> {
|
pub(crate) fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaration> {
|
||||||
let (s, a) = keyword("typedef")(s)?;
|
let (s, a) = keyword("typedef")(s)?;
|
||||||
let (s, b) = opt(type_declaration_keyword)(s)?;
|
let (s, b) = opt(type_declaration_keyword)(s)?;
|
||||||
@ -284,6 +307,7 @@ pub(crate) fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword> {
|
pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("enum"), |x| {
|
map(keyword("enum"), |x| {
|
||||||
@ -305,6 +329,7 @@ pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
net_type_declaration_data_type,
|
net_type_declaration_data_type,
|
||||||
@ -313,6 +338,7 @@ pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
||||||
let (s, a) = keyword("nettype")(s)?;
|
let (s, a) = keyword("nettype")(s)?;
|
||||||
let (s, b) = data_type(s)?;
|
let (s, b) = data_type(s)?;
|
||||||
@ -332,6 +358,7 @@ pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
pub(crate) fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
|
||||||
let (s, a) = keyword("nettype")(s)?;
|
let (s, a) = keyword("nettype")(s)?;
|
||||||
let (s, b) = opt(package_scope_or_class_scope)(s)?;
|
let (s, b) = opt(package_scope_or_class_scope)(s)?;
|
||||||
@ -347,6 +374,7 @@ pub(crate) fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn lifetime(s: Span) -> IResult<Span, Lifetime> {
|
pub(crate) fn lifetime(s: Span) -> IResult<Span, Lifetime> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("static"), |x| Lifetime::Static(Box::new(x))),
|
map(keyword("static"), |x| Lifetime::Static(Box::new(x))),
|
||||||
|
@ -3,18 +3,21 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn concatenation(s: Span) -> IResult<Span, Concatenation> {
|
pub(crate) fn concatenation(s: Span) -> IResult<Span, Concatenation> {
|
||||||
let (s, a) = brace(list(symbol(","), expression))(s)?;
|
let (s, a) = brace(list(symbol(","), expression))(s)?;
|
||||||
Ok((s, Concatenation { nodes: (a,) }))
|
Ok((s, Concatenation { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_concatenation(s: Span) -> IResult<Span, ConstantConcatenation> {
|
pub(crate) fn constant_concatenation(s: Span) -> IResult<Span, ConstantConcatenation> {
|
||||||
let (s, a) = brace(list(symbol(","), constant_expression))(s)?;
|
let (s, a) = brace(list(symbol(","), constant_expression))(s)?;
|
||||||
Ok((s, ConstantConcatenation { nodes: (a,) }))
|
Ok((s, ConstantConcatenation { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_multiple_concatenation(
|
pub(crate) fn constant_multiple_concatenation(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConstantMultipleConcatenation> {
|
) -> IResult<Span, ConstantMultipleConcatenation> {
|
||||||
@ -23,12 +26,14 @@ pub(crate) fn constant_multiple_concatenation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_concatenation(s: Span) -> IResult<Span, ModulePathConcatenation> {
|
pub(crate) fn module_path_concatenation(s: Span) -> IResult<Span, ModulePathConcatenation> {
|
||||||
let (s, a) = brace(list(symbol(","), module_path_expression))(s)?;
|
let (s, a) = brace(list(symbol(","), module_path_expression))(s)?;
|
||||||
Ok((s, ModulePathConcatenation { nodes: (a,) }))
|
Ok((s, ModulePathConcatenation { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_multiple_concatenation(
|
pub(crate) fn module_path_multiple_concatenation(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModulePathMultipleConcatenation> {
|
) -> IResult<Span, ModulePathMultipleConcatenation> {
|
||||||
@ -37,12 +42,14 @@ pub(crate) fn module_path_multiple_concatenation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn multiple_concatenation(s: Span) -> IResult<Span, MultipleConcatenation> {
|
pub(crate) fn multiple_concatenation(s: Span) -> IResult<Span, MultipleConcatenation> {
|
||||||
let (s, a) = brace(pair(expression, concatenation))(s)?;
|
let (s, a) = brace(pair(expression, concatenation))(s)?;
|
||||||
Ok((s, MultipleConcatenation { nodes: (a,) }))
|
Ok((s, MultipleConcatenation { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
|
pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
|
||||||
let (s, a) = brace(triple(
|
let (s, a) = brace(triple(
|
||||||
stream_operator,
|
stream_operator,
|
||||||
@ -53,6 +60,7 @@ pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcate
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
|
pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol(">>"), |x| StreamOperator { nodes: (x,) }),
|
map(symbol(">>"), |x| StreamOperator { nodes: (x,) }),
|
||||||
@ -61,6 +69,7 @@ pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
|
pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
|
||||||
alt((
|
alt((
|
||||||
map(simple_type, |x| SliceSize::SimpleType(Box::new(x))),
|
map(simple_type, |x| SliceSize::SimpleType(Box::new(x))),
|
||||||
@ -71,6 +80,7 @@ pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation> {
|
pub(crate) fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation> {
|
||||||
let (s, a) = brace(list(symbol(","), stream_expression))(s)?;
|
let (s, a) = brace(list(symbol(","), stream_expression))(s)?;
|
||||||
Ok((s, StreamConcatenation { nodes: (a,) }))
|
Ok((s, StreamConcatenation { nodes: (a,) }))
|
||||||
@ -78,6 +88,7 @@ pub(crate) fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn stream_expression(s: Span) -> IResult<Span, StreamExpression> {
|
pub(crate) fn stream_expression(s: Span) -> IResult<Span, StreamExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = opt(pair(keyword("with"), bracket(array_range_expression)))(s)?;
|
let (s, b) = opt(pair(keyword("with"), bracket(array_range_expression)))(s)?;
|
||||||
@ -85,6 +96,7 @@ pub(crate) fn stream_expression(s: Span) -> IResult<Span, StreamExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
pub(crate) fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(expression, |x| {
|
map(expression, |x| {
|
||||||
@ -98,6 +110,7 @@ pub(crate) fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpress
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -110,6 +123,7 @@ pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeE
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol("+:")(s)?;
|
let (s, b) = symbol("+:")(s)?;
|
||||||
@ -124,6 +138,7 @@ pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayR
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol("-:")(s)?;
|
let (s, b) = symbol("-:")(s)?;
|
||||||
@ -137,6 +152,7 @@ pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult<Span, Array
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn empty_unpacked_array_concatenation(
|
pub(crate) fn empty_unpacked_array_concatenation(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, EmptyUnpackedArrayConcatenation> {
|
) -> IResult<Span, EmptyUnpackedArrayConcatenation> {
|
||||||
|
@ -2,13 +2,14 @@ use crate::*;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_lvalue(s: Span) -> IResult<Span, NetLvalue> {
|
pub(crate) fn net_lvalue(s: Span) -> IResult<Span, NetLvalue> {
|
||||||
alt((net_lvalue_identifier, net_lvalue_lvalue, net_lvalue_pattern))(s)
|
alt((net_lvalue_identifier, net_lvalue_lvalue, net_lvalue_pattern))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
|
pub(crate) fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
|
||||||
let (s, a) = ps_or_hierarchical_net_identifier(s)?;
|
let (s, a) = ps_or_hierarchical_net_identifier(s)?;
|
||||||
let (s, b) = constant_select(s)?;
|
let (s, b) = constant_select(s)?;
|
||||||
@ -19,6 +20,7 @@ pub(crate) fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
|
pub(crate) fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
|
||||||
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
||||||
let (s, b) = assignment_pattern_net_lvalue(s)?;
|
let (s, b) = assignment_pattern_net_lvalue(s)?;
|
||||||
@ -29,6 +31,7 @@ pub(crate) fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
|
pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
|
||||||
let (s, a) = brace(list(symbol(","), net_lvalue))(s)?;
|
let (s, a) = brace(list(symbol(","), net_lvalue))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -37,8 +40,8 @@ pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
||||||
alt((
|
alt((
|
||||||
variable_lvalue_identifier,
|
variable_lvalue_identifier,
|
||||||
@ -51,6 +54,7 @@ pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalue> {
|
pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalue> {
|
||||||
let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?;
|
let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?;
|
||||||
let (s, b) = hierarchical_variable_identifier(s)?;
|
let (s, b) = hierarchical_variable_identifier(s)?;
|
||||||
@ -62,6 +66,7 @@ pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalu
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue> {
|
pub(crate) fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue> {
|
||||||
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
let (s, a) = opt(assignment_pattern_expression_type)(s)?;
|
||||||
let (s, b) = assignment_pattern_variable_lvalue(s)?;
|
let (s, b) = assignment_pattern_variable_lvalue(s)?;
|
||||||
@ -72,6 +77,7 @@ pub(crate) fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
||||||
let (s, a) = brace(list(symbol(","), variable_lvalue))(s)?;
|
let (s, a) = brace(list(symbol(","), variable_lvalue))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -81,6 +87,7 @@ pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn nonrange_variable_lvalue(s: Span) -> IResult<Span, NonrangeVariableLvalue> {
|
pub(crate) fn nonrange_variable_lvalue(s: Span) -> IResult<Span, NonrangeVariableLvalue> {
|
||||||
let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?;
|
let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?;
|
||||||
let (s, b) = hierarchical_variable_identifier(s)?;
|
let (s, b) = hierarchical_variable_identifier(s)?;
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inc_or_dec_expression(s: Span) -> IResult<Span, IncOrDecExpression> {
|
pub(crate) fn inc_or_dec_expression(s: Span) -> IResult<Span, IncOrDecExpression> {
|
||||||
alt((inc_or_dec_expression_prefix, inc_or_dec_expression_suffix))(s)
|
alt((inc_or_dec_expression_prefix, inc_or_dec_expression_suffix))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inc_or_dec_expression_prefix(s: Span) -> IResult<Span, IncOrDecExpression> {
|
pub(crate) fn inc_or_dec_expression_prefix(s: Span) -> IResult<Span, IncOrDecExpression> {
|
||||||
let (s, a) = inc_or_dec_operator(s)?;
|
let (s, a) = inc_or_dec_operator(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -20,6 +22,7 @@ pub(crate) fn inc_or_dec_expression_prefix(s: Span) -> IResult<Span, IncOrDecExp
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression> {
|
pub(crate) fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression> {
|
||||||
let (s, a) = variable_lvalue(s)?;
|
let (s, a) = variable_lvalue(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -32,6 +35,7 @@ pub(crate) fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExp
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
|
pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
|
||||||
let (s, a) = cond_predicate(s)?;
|
let (s, a) = cond_predicate(s)?;
|
||||||
let (s, b) = symbol("?")(s)?;
|
let (s, b) = symbol("?")(s)?;
|
||||||
@ -47,8 +51,8 @@ pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpres
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
|
pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
|
||||||
alt((
|
alt((
|
||||||
constant_expression_binary,
|
constant_expression_binary,
|
||||||
@ -61,6 +65,7 @@ pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
|
pub(crate) fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||||
let (s, a) = unary_operator(s)?;
|
let (s, a) = unary_operator(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -73,6 +78,7 @@ pub(crate) fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpres
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
|
pub(crate) fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
let (s, b) = binary_operator(s)?;
|
let (s, b) = binary_operator(s)?;
|
||||||
@ -88,6 +94,7 @@ pub(crate) fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpre
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
|
pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
let (s, b) = symbol("?")(s)?;
|
let (s, b) = symbol("?")(s)?;
|
||||||
@ -104,6 +111,7 @@ pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmaxExpression> {
|
pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmaxExpression> {
|
||||||
alt((
|
alt((
|
||||||
constant_mintypmax_expression_ternary,
|
constant_mintypmax_expression_ternary,
|
||||||
@ -115,6 +123,7 @@ pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMi
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_mintypmax_expression_ternary(
|
pub(crate) fn constant_mintypmax_expression_ternary(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConstantMintypmaxExpression> {
|
) -> IResult<Span, ConstantMintypmaxExpression> {
|
||||||
@ -132,6 +141,7 @@ pub(crate) fn constant_mintypmax_expression_ternary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpression> {
|
pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("$"), |x| {
|
map(symbol("$"), |x| {
|
||||||
@ -147,6 +157,7 @@ pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
|
pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("$"), |x| ParamExpression::Dollar(Box::new(x))),
|
map(symbol("$"), |x| ParamExpression::Dollar(Box::new(x))),
|
||||||
@ -158,6 +169,7 @@ pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpression> {
|
pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(constant_part_select_range, |x| {
|
map(constant_part_select_range, |x| {
|
||||||
@ -170,6 +182,7 @@ pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeE
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRange> {
|
pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRange> {
|
||||||
alt((
|
alt((
|
||||||
map(constant_range, |x| {
|
map(constant_range, |x| {
|
||||||
@ -183,6 +196,7 @@ pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartS
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
|
pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -192,6 +206,7 @@ pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
|
pub(crate) fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
|
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
|
||||||
@ -199,8 +214,8 @@ pub(crate) fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRa
|
|||||||
Ok((s, ConstantIndexedRange { nodes: (a, b, c) }))
|
Ok((s, ConstantIndexedRange { nodes: (a, b, c) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
|
pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
|
||||||
alt((
|
alt((
|
||||||
expression_binary,
|
expression_binary,
|
||||||
@ -223,6 +238,7 @@ pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression_unary(s: Span) -> IResult<Span, Expression> {
|
pub(crate) fn expression_unary(s: Span) -> IResult<Span, Expression> {
|
||||||
let (s, x) = unary_operator(s)?;
|
let (s, x) = unary_operator(s)?;
|
||||||
let (s, y) = many0(attribute_instance)(s)?;
|
let (s, y) = many0(attribute_instance)(s)?;
|
||||||
@ -234,6 +250,7 @@ pub(crate) fn expression_unary(s: Span) -> IResult<Span, Expression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
|
pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
|
||||||
let (s, a) = paren(operator_assignment)(s)?;
|
let (s, a) = paren(operator_assignment)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -244,6 +261,7 @@ pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expressio
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
|
pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = binary_operator(s)?;
|
let (s, b) = binary_operator(s)?;
|
||||||
@ -258,6 +276,7 @@ pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
|
pub(crate) fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
|
||||||
let (s, a) = keyword("tagged")(s)?;
|
let (s, a) = keyword("tagged")(s)?;
|
||||||
let (s, b) = member_identifier(s)?;
|
let (s, b) = member_identifier(s)?;
|
||||||
@ -267,6 +286,7 @@ pub(crate) fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpre
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
|
pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = keyword("inside")(s)?;
|
let (s, b) = keyword("inside")(s)?;
|
||||||
@ -275,6 +295,7 @@ pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
|
pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
|
||||||
alt((
|
alt((
|
||||||
value_range_binary,
|
value_range_binary,
|
||||||
@ -283,6 +304,7 @@ pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
|
pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
|
||||||
let (s, a) = bracket(triple(expression, symbol(":"), expression))(s)?;
|
let (s, a) = bracket(triple(expression, symbol(":"), expression))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -292,6 +314,7 @@ pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
|
pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
|
||||||
alt((
|
alt((
|
||||||
mintypmax_expression_ternary,
|
mintypmax_expression_ternary,
|
||||||
@ -301,6 +324,7 @@ pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpression> {
|
pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -317,6 +341,7 @@ pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxEx
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_conditional_expression(
|
pub(crate) fn module_path_conditional_expression(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModulePathConditionalExpression> {
|
) -> IResult<Span, ModulePathConditionalExpression> {
|
||||||
@ -335,6 +360,7 @@ pub(crate) fn module_path_conditional_expression(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
|
pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(module_path_primary, |x| {
|
map(module_path_primary, |x| {
|
||||||
@ -349,6 +375,7 @@ pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpress
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathExpression> {
|
pub(crate) fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathExpression> {
|
||||||
let (s, a) = unary_module_path_operator(s)?;
|
let (s, a) = unary_module_path_operator(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -361,6 +388,7 @@ pub(crate) fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathE
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePathExpression> {
|
pub(crate) fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePathExpression> {
|
||||||
let (s, a) = module_path_expression(s)?;
|
let (s, a) = module_path_expression(s)?;
|
||||||
let (s, b) = binary_module_path_operator(s)?;
|
let (s, b) = binary_module_path_operator(s)?;
|
||||||
@ -375,6 +403,7 @@ pub(crate) fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePath
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_mintypmax_expression(
|
pub(crate) fn module_path_mintypmax_expression(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModulePathMintypmaxExpression> {
|
) -> IResult<Span, ModulePathMintypmaxExpression> {
|
||||||
@ -388,6 +417,7 @@ pub(crate) fn module_path_mintypmax_expression(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_mintypmax_expression_ternary(
|
pub(crate) fn module_path_mintypmax_expression_ternary(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModulePathMintypmaxExpression> {
|
) -> IResult<Span, ModulePathMintypmaxExpression> {
|
||||||
@ -405,6 +435,7 @@ pub(crate) fn module_path_mintypmax_expression_ternary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
|
pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
|
||||||
alt((
|
alt((
|
||||||
map(constant_range, |x| {
|
map(constant_range, |x| {
|
||||||
@ -418,6 +449,7 @@ pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
|
pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
|
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
|
||||||
@ -426,6 +458,7 @@ pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_expression(s: Span) -> IResult<Span, GenvarExpression> {
|
pub(crate) fn genvar_expression(s: Span) -> IResult<Span, GenvarExpression> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
Ok((s, GenvarExpression { nodes: (a,) }))
|
Ok((s, GenvarExpression { nodes: (a,) }))
|
||||||
|
@ -2,8 +2,8 @@ use crate::*;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn number(s: Span) -> IResult<Span, Number> {
|
pub(crate) fn number(s: Span) -> IResult<Span, Number> {
|
||||||
alt((
|
alt((
|
||||||
map(real_number, |x| Number::RealNumber(Box::new(x))),
|
map(real_number, |x| Number::RealNumber(Box::new(x))),
|
||||||
@ -12,6 +12,7 @@ pub(crate) fn number(s: Span) -> IResult<Span, Number> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
|
pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
|
||||||
alt((
|
alt((
|
||||||
map(octal_number, |x| IntegralNumber::OctalNumber(Box::new(x))),
|
map(octal_number, |x| IntegralNumber::OctalNumber(Box::new(x))),
|
||||||
@ -24,6 +25,7 @@ pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
|
pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
|
||||||
alt((
|
alt((
|
||||||
decimal_number_base_unsigned,
|
decimal_number_base_unsigned,
|
||||||
@ -36,6 +38,7 @@ pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
|
pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = decimal_base(s)?;
|
let (s, b) = decimal_base(s)?;
|
||||||
@ -47,6 +50,7 @@ pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumb
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumber> {
|
pub(crate) fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = decimal_base(s)?;
|
let (s, b) = decimal_base(s)?;
|
||||||
@ -58,6 +62,7 @@ pub(crate) fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumb
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumber> {
|
pub(crate) fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = decimal_base(s)?;
|
let (s, b) = decimal_base(s)?;
|
||||||
@ -69,6 +74,7 @@ pub(crate) fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumb
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
|
pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = binary_base(s)?;
|
let (s, b) = binary_base(s)?;
|
||||||
@ -77,6 +83,7 @@ pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
|
pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = octal_base(s)?;
|
let (s, b) = octal_base(s)?;
|
||||||
@ -85,6 +92,7 @@ pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
|
pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
|
||||||
let (s, a) = opt(size)(s)?;
|
let (s, a) = opt(size)(s)?;
|
||||||
let (s, b) = hex_base(s)?;
|
let (s, b) = hex_base(s)?;
|
||||||
@ -93,6 +101,7 @@ pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
|
pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("+"), |x| Sign::Plus(Box::new(x))),
|
map(symbol("+"), |x| Sign::Plus(Box::new(x))),
|
||||||
@ -101,12 +110,14 @@ pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn size(s: Span) -> IResult<Span, Size> {
|
pub(crate) fn size(s: Span) -> IResult<Span, Size> {
|
||||||
let (s, a) = non_zero_unsigned_number(s)?;
|
let (s, a) = non_zero_unsigned_number(s)?;
|
||||||
Ok((s, Size { nodes: (a,) }))
|
Ok((s, Size { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_zero_unsigned_number(s: Span) -> IResult<Span, NonZeroUnsignedNumber> {
|
pub(crate) fn non_zero_unsigned_number(s: Span) -> IResult<Span, NonZeroUnsignedNumber> {
|
||||||
let (s, a) = ws(non_zero_unsigned_number_impl)(s)?;
|
let (s, a) = ws(non_zero_unsigned_number_impl)(s)?;
|
||||||
Ok((s, NonZeroUnsignedNumber { nodes: a }))
|
Ok((s, NonZeroUnsignedNumber { nodes: a }))
|
||||||
@ -122,6 +133,7 @@ pub(crate) fn non_zero_unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
|
pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
|
||||||
alt((
|
alt((
|
||||||
real_number_floating,
|
real_number_floating,
|
||||||
@ -132,6 +144,7 @@ pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
|
pub(crate) fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
|
||||||
let (s, a) = unsigned_number(s)?;
|
let (s, a) = unsigned_number(s)?;
|
||||||
let (s, b) = opt(pair(symbol("."), unsigned_number))(s)?;
|
let (s, b) = opt(pair(symbol("."), unsigned_number))(s)?;
|
||||||
@ -147,6 +160,7 @@ pub(crate) fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
|
pub(crate) fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
|
||||||
let (s, a) = unsigned_number(s)?;
|
let (s, a) = unsigned_number(s)?;
|
||||||
let (s, b) = map(tag("."), |x: Span| Symbol {
|
let (s, b) = map(tag("."), |x: Span| Symbol {
|
||||||
@ -157,12 +171,14 @@ pub(crate) fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn exp(s: Span) -> IResult<Span, Exp> {
|
pub(crate) fn exp(s: Span) -> IResult<Span, Exp> {
|
||||||
let (s, a) = alt((symbol("e"), symbol("E")))(s)?;
|
let (s, a) = alt((symbol("e"), symbol("E")))(s)?;
|
||||||
Ok((s, Exp { nodes: (a,) }))
|
Ok((s, Exp { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unsigned_number(s: Span) -> IResult<Span, UnsignedNumber> {
|
pub(crate) fn unsigned_number(s: Span) -> IResult<Span, UnsignedNumber> {
|
||||||
let (s, a) = ws(unsigned_number_impl)(s)?;
|
let (s, a) = ws(unsigned_number_impl)(s)?;
|
||||||
Ok((s, UnsignedNumber { nodes: a }))
|
Ok((s, UnsignedNumber { nodes: a }))
|
||||||
@ -178,6 +194,7 @@ pub(crate) fn unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
|
pub(crate) fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
|
||||||
let (s, a) = ws(binary_value_impl)(s)?;
|
let (s, a) = ws(binary_value_impl)(s)?;
|
||||||
Ok((s, BinaryValue { nodes: a }))
|
Ok((s, BinaryValue { nodes: a }))
|
||||||
@ -193,6 +210,7 @@ pub(crate) fn binary_value_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn octal_value(s: Span) -> IResult<Span, OctalValue> {
|
pub(crate) fn octal_value(s: Span) -> IResult<Span, OctalValue> {
|
||||||
let (s, a) = ws(octal_value_impl)(s)?;
|
let (s, a) = ws(octal_value_impl)(s)?;
|
||||||
Ok((s, OctalValue { nodes: a }))
|
Ok((s, OctalValue { nodes: a }))
|
||||||
@ -208,6 +226,7 @@ pub(crate) fn octal_value_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hex_value(s: Span) -> IResult<Span, HexValue> {
|
pub(crate) fn hex_value(s: Span) -> IResult<Span, HexValue> {
|
||||||
let (s, a) = ws(hex_value_impl)(s)?;
|
let (s, a) = ws(hex_value_impl)(s)?;
|
||||||
Ok((s, HexValue { nodes: a }))
|
Ok((s, HexValue { nodes: a }))
|
||||||
@ -225,6 +244,7 @@ pub(crate) fn hex_value_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
|
pub(crate) fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
|
||||||
let (s, a) = ws(decimal_base_impl)(s)?;
|
let (s, a) = ws(decimal_base_impl)(s)?;
|
||||||
Ok((s, DecimalBase { nodes: a }))
|
Ok((s, DecimalBase { nodes: a }))
|
||||||
@ -237,6 +257,7 @@ pub(crate) fn decimal_base_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn binary_base(s: Span) -> IResult<Span, BinaryBase> {
|
pub(crate) fn binary_base(s: Span) -> IResult<Span, BinaryBase> {
|
||||||
let (s, a) = ws(binary_base_impl)(s)?;
|
let (s, a) = ws(binary_base_impl)(s)?;
|
||||||
Ok((s, BinaryBase { nodes: a }))
|
Ok((s, BinaryBase { nodes: a }))
|
||||||
@ -249,6 +270,7 @@ pub(crate) fn binary_base_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn octal_base(s: Span) -> IResult<Span, OctalBase> {
|
pub(crate) fn octal_base(s: Span) -> IResult<Span, OctalBase> {
|
||||||
let (s, a) = ws(octal_base_impl)(s)?;
|
let (s, a) = ws(octal_base_impl)(s)?;
|
||||||
Ok((s, OctalBase { nodes: a }))
|
Ok((s, OctalBase { nodes: a }))
|
||||||
@ -261,6 +283,7 @@ pub(crate) fn octal_base_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hex_base(s: Span) -> IResult<Span, HexBase> {
|
pub(crate) fn hex_base(s: Span) -> IResult<Span, HexBase> {
|
||||||
let (s, a) = ws(hex_base_impl)(s)?;
|
let (s, a) = ws(hex_base_impl)(s)?;
|
||||||
Ok((s, HexBase { nodes: a }))
|
Ok((s, HexBase { nodes: a }))
|
||||||
@ -273,6 +296,7 @@ pub(crate) fn hex_base_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn x_number(s: Span) -> IResult<Span, XNumber> {
|
pub(crate) fn x_number(s: Span) -> IResult<Span, XNumber> {
|
||||||
let (s, a) = ws(x_number_impl)(s)?;
|
let (s, a) = ws(x_number_impl)(s)?;
|
||||||
Ok((s, XNumber { nodes: a }))
|
Ok((s, XNumber { nodes: a }))
|
||||||
@ -288,6 +312,7 @@ pub(crate) fn x_number_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn z_number(s: Span) -> IResult<Span, ZNumber> {
|
pub(crate) fn z_number(s: Span) -> IResult<Span, ZNumber> {
|
||||||
let (s, a) = ws(z_number_impl)(s)?;
|
let (s, a) = ws(z_number_impl)(s)?;
|
||||||
Ok((s, ZNumber { nodes: a }))
|
Ok((s, ZNumber { nodes: a }))
|
||||||
@ -303,6 +328,7 @@ pub(crate) fn z_number_impl(s: Span) -> IResult<Span, Locate> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unbased_unsized_literal(s: Span) -> IResult<Span, UnbasedUnsizedLiteral> {
|
pub(crate) fn unbased_unsized_literal(s: Span) -> IResult<Span, UnbasedUnsizedLiteral> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
symbol("'0"),
|
symbol("'0"),
|
||||||
|
@ -2,8 +2,8 @@ use crate::*;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
|
pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
symbol("+"),
|
symbol("+"),
|
||||||
@ -22,6 +22,7 @@ pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
|
pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
alt((
|
alt((
|
||||||
@ -62,12 +63,14 @@ pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inc_or_dec_operator(s: Span) -> IResult<Span, IncOrDecOperator> {
|
pub(crate) fn inc_or_dec_operator(s: Span) -> IResult<Span, IncOrDecOperator> {
|
||||||
let (s, a) = alt((symbol("++"), symbol("--")))(s)?;
|
let (s, a) = alt((symbol("++"), symbol("--")))(s)?;
|
||||||
Ok((s, IncOrDecOperator { nodes: (a,) }))
|
Ok((s, IncOrDecOperator { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePathOperator> {
|
pub(crate) fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePathOperator> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
symbol("!"),
|
symbol("!"),
|
||||||
@ -84,6 +87,7 @@ pub(crate) fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn binary_module_path_operator(s: Span) -> IResult<Span, BinaryModulePathOperator> {
|
pub(crate) fn binary_module_path_operator(s: Span) -> IResult<Span, BinaryModulePathOperator> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
symbol("=="),
|
symbol("=="),
|
||||||
|
@ -2,8 +2,8 @@ use crate::*;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("null"), |x| ConstantPrimary::Null(Box::new(x))),
|
map(keyword("null"), |x| ConstantPrimary::Null(Box::new(x))),
|
||||||
@ -39,6 +39,7 @@ pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = ps_parameter_identifier(s)?;
|
let (s, a) = ps_parameter_identifier(s)?;
|
||||||
let (s, b) = constant_select(s)?;
|
let (s, b) = constant_select(s)?;
|
||||||
@ -49,6 +50,7 @@ pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = specparam_identifier(s)?;
|
let (s, a) = specparam_identifier(s)?;
|
||||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||||
@ -59,6 +61,7 @@ pub(crate) fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrima
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = formal_port_identifier(s)?;
|
let (s, a) = formal_port_identifier(s)?;
|
||||||
let (s, b) = constant_select(s)?;
|
let (s, b) = constant_select(s)?;
|
||||||
@ -69,6 +72,7 @@ pub(crate) fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPri
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = package_scope_or_class_scope(s)?;
|
let (s, a) = package_scope_or_class_scope(s)?;
|
||||||
let (s, b) = enum_identifier(s)?;
|
let (s, b) = enum_identifier(s)?;
|
||||||
@ -79,6 +83,7 @@ pub(crate) fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = constant_concatenation(s)?;
|
let (s, a) = constant_concatenation(s)?;
|
||||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||||
@ -89,6 +94,7 @@ pub(crate) fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = constant_multiple_concatenation(s)?;
|
let (s, a) = constant_multiple_concatenation(s)?;
|
||||||
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
let (s, b) = opt(bracket(constant_range_expression))(s)?;
|
||||||
@ -101,6 +107,7 @@ pub(crate) fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
|
pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||||
let (s, a) = paren(constant_mintypmax_expression)(s)?;
|
let (s, a) = paren(constant_mintypmax_expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -112,6 +119,7 @@ pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
|
pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
|
||||||
alt((
|
alt((
|
||||||
map(number, |x| ModulePathPrimary::Number(Box::new(x))),
|
map(number, |x| ModulePathPrimary::Number(Box::new(x))),
|
||||||
@ -130,6 +138,7 @@ pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_path_primary_mintypmax_expression(
|
pub(crate) fn module_path_primary_mintypmax_expression(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModulePathPrimary> {
|
) -> IResult<Span, ModulePathPrimary> {
|
||||||
@ -140,8 +149,8 @@ pub(crate) fn module_path_primary_mintypmax_expression(
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
|
pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("this"), |x| Primary::This(Box::new(x))),
|
map(keyword("this"), |x| Primary::This(Box::new(x))),
|
||||||
@ -173,6 +182,7 @@ pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
|
pub(crate) fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
|
||||||
let (s, a) = opt(class_qualifier_or_package_scope)(s)?;
|
let (s, a) = opt(class_qualifier_or_package_scope)(s)?;
|
||||||
let (s, b) = hierarchical_identifier(s)?;
|
let (s, b) = hierarchical_identifier(s)?;
|
||||||
@ -184,6 +194,7 @@ pub(crate) fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
|
pub(crate) fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
|
||||||
let (s, a) = concatenation(s)?;
|
let (s, a) = concatenation(s)?;
|
||||||
let (s, b) = opt(bracket(range_expression))(s)?;
|
let (s, b) = opt(bracket(range_expression))(s)?;
|
||||||
@ -194,6 +205,7 @@ pub(crate) fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
|
pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
|
||||||
let (s, a) = multiple_concatenation(s)?;
|
let (s, a) = multiple_concatenation(s)?;
|
||||||
let (s, b) = opt(bracket(range_expression))(s)?;
|
let (s, b) = opt(bracket(range_expression))(s)?;
|
||||||
@ -204,6 +216,7 @@ pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
|
pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
|
||||||
let (s, a) = paren(mintypmax_expression)(s)?;
|
let (s, a) = paren(mintypmax_expression)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -213,6 +226,7 @@ pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_qualifier_or_package_scope(
|
pub(crate) fn class_qualifier_or_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ClassQualifierOrPackageScope> {
|
) -> IResult<Span, ClassQualifierOrPackageScope> {
|
||||||
@ -228,6 +242,7 @@ pub(crate) fn class_qualifier_or_package_scope(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_qualifier(s: Span) -> IResult<Span, ClassQualifier> {
|
pub(crate) fn class_qualifier(s: Span) -> IResult<Span, ClassQualifier> {
|
||||||
let (s, a) = opt(local)(s)?;
|
let (s, a) = opt(local)(s)?;
|
||||||
let (s, b) = opt(implicit_class_handle_or_class_scope)(s)?;
|
let (s, b) = opt(implicit_class_handle_or_class_scope)(s)?;
|
||||||
@ -235,6 +250,7 @@ pub(crate) fn class_qualifier(s: Span) -> IResult<Span, ClassQualifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
|
pub(crate) fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(expression, |x| RangeExpression::Expression(Box::new(x))),
|
map(expression, |x| RangeExpression::Expression(Box::new(x))),
|
||||||
@ -244,8 +260,8 @@ pub(crate) fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
|
pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
|
||||||
alt((
|
alt((
|
||||||
map(time_literal, |x| PrimaryLiteral::TimeLiteral(Box::new(x))),
|
map(time_literal, |x| PrimaryLiteral::TimeLiteral(Box::new(x))),
|
||||||
@ -260,11 +276,13 @@ pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn time_literal(s: Span) -> IResult<Span, TimeLiteral> {
|
pub(crate) fn time_literal(s: Span) -> IResult<Span, TimeLiteral> {
|
||||||
alt((time_literal_unsigned, time_literal_fixed_point))(s)
|
alt((time_literal_unsigned, time_literal_fixed_point))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
|
pub(crate) fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
|
||||||
let (s, a) = unsigned_number(s)?;
|
let (s, a) = unsigned_number(s)?;
|
||||||
let (s, b) = time_unit(s)?;
|
let (s, b) = time_unit(s)?;
|
||||||
@ -275,6 +293,7 @@ pub(crate) fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
|
pub(crate) fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
|
||||||
let (s, a) = fixed_point_number(s)?;
|
let (s, a) = fixed_point_number(s)?;
|
||||||
let (s, b) = time_unit(s)?;
|
let (s, b) = time_unit(s)?;
|
||||||
@ -285,6 +304,7 @@ pub(crate) fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
|
pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("s"), |x| TimeUnit::S(Box::new(x))),
|
map(keyword("s"), |x| TimeUnit::S(Box::new(x))),
|
||||||
@ -297,6 +317,7 @@ pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
|
pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
|
||||||
alt((
|
alt((
|
||||||
map(
|
map(
|
||||||
@ -311,12 +332,14 @@ pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bit_select(s: Span) -> IResult<Span, BitSelect> {
|
pub(crate) fn bit_select(s: Span) -> IResult<Span, BitSelect> {
|
||||||
let (s, a) = many0(bracket(expression))(s)?;
|
let (s, a) = many0(bracket(expression))(s)?;
|
||||||
Ok((s, BitSelect { nodes: (a,) }))
|
Ok((s, BitSelect { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn select(s: Span) -> IResult<Span, Select> {
|
pub(crate) fn select(s: Span) -> IResult<Span, Select> {
|
||||||
let (s, a) = opt(triple(
|
let (s, a) = opt(triple(
|
||||||
many0(terminated(
|
many0(terminated(
|
||||||
@ -332,6 +355,7 @@ pub(crate) fn select(s: Span) -> IResult<Span, Select> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
|
pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
|
||||||
let (s, a) = opt(triple(
|
let (s, a) = opt(triple(
|
||||||
many0(triple(symbol("."), member_identifier, bit_select)),
|
many0(triple(symbol("."), member_identifier, bit_select)),
|
||||||
@ -343,12 +367,14 @@ pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_bit_select(s: Span) -> IResult<Span, ConstantBitSelect> {
|
pub(crate) fn constant_bit_select(s: Span) -> IResult<Span, ConstantBitSelect> {
|
||||||
let (s, a) = many0(bracket(constant_expression))(s)?;
|
let (s, a) = many0(bracket(constant_expression))(s)?;
|
||||||
Ok((s, ConstantBitSelect { nodes: (a,) }))
|
Ok((s, ConstantBitSelect { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
|
pub(crate) fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
|
||||||
let (s, a) = opt(triple(
|
let (s, a) = opt(triple(
|
||||||
many0(terminated(
|
many0(terminated(
|
||||||
@ -365,6 +391,7 @@ pub(crate) fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
|
pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
|
||||||
let (s, a) = casting_type(s)?;
|
let (s, a) = casting_type(s)?;
|
||||||
let (s, b) = symbol("'")(s)?;
|
let (s, b) = symbol("'")(s)?;
|
||||||
@ -373,6 +400,7 @@ pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
|
pub(crate) fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
|
||||||
let (s, a) = let_expression(s)?;
|
let (s, a) = let_expression(s)?;
|
||||||
Ok((s, ConstantLetExpression { nodes: (a,) }))
|
Ok((s, ConstantLetExpression { nodes: (a,) }))
|
||||||
@ -380,6 +408,7 @@ pub(crate) fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpre
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cast(s: Span) -> IResult<Span, Cast> {
|
pub(crate) fn cast(s: Span) -> IResult<Span, Cast> {
|
||||||
let (s, a) = casting_type(s)?;
|
let (s, a) = casting_type(s)?;
|
||||||
let (s, b) = symbol("'")(s)?;
|
let (s, b) = symbol("'")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
|
pub(crate) fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
|
||||||
let (s, a) = ws(string_literal_impl)(s)?;
|
let (s, a) = ws(string_literal_impl)(s)?;
|
||||||
Ok((s, StringLiteral { nodes: a }))
|
Ok((s, StringLiteral { nodes: a }))
|
||||||
|
@ -3,12 +3,14 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constant_function_call(s: Span) -> IResult<Span, ConstantFunctionCall> {
|
pub(crate) fn constant_function_call(s: Span) -> IResult<Span, ConstantFunctionCall> {
|
||||||
let (s, a) = function_subroutine_call(s)?;
|
let (s, a) = function_subroutine_call(s)?;
|
||||||
Ok((s, ConstantFunctionCall { nodes: (a,) }))
|
Ok((s, ConstantFunctionCall { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn tf_call(s: Span) -> IResult<Span, TfCall> {
|
pub(crate) fn tf_call(s: Span) -> IResult<Span, TfCall> {
|
||||||
let (s, a) = ps_or_hierarchical_tf_identifier(s)?;
|
let (s, a) = ps_or_hierarchical_tf_identifier(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -17,6 +19,7 @@ pub(crate) fn tf_call(s: Span) -> IResult<Span, TfCall> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
|
pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
|
||||||
alt((
|
alt((
|
||||||
system_tf_call_arg_optional,
|
system_tf_call_arg_optional,
|
||||||
@ -26,6 +29,7 @@ pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall> {
|
pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall> {
|
||||||
let (s, a) = system_tf_identifier(s)?;
|
let (s, a) = system_tf_identifier(s)?;
|
||||||
let (s, b) = opt(paren(list_of_arguments))(s)?;
|
let (s, b) = opt(paren(list_of_arguments))(s)?;
|
||||||
@ -36,6 +40,7 @@ pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCall> {
|
pub(crate) fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCall> {
|
||||||
let (s, a) = system_tf_identifier(s)?;
|
let (s, a) = system_tf_identifier(s)?;
|
||||||
let (s, b) = paren(pair(data_type, opt(pair(symbol(","), expression))))(s)?;
|
let (s, b) = paren(pair(data_type, opt(pair(symbol(","), expression))))(s)?;
|
||||||
@ -46,6 +51,7 @@ pub(crate) fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCal
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCall> {
|
pub(crate) fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCall> {
|
||||||
let (s, a) = system_tf_identifier(s)?;
|
let (s, a) = system_tf_identifier(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -58,8 +64,8 @@ pub(crate) fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCa
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
|
pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
|
||||||
alt((
|
alt((
|
||||||
map(method_call, |x| SubroutineCall::MethodCall(Box::new(x))),
|
map(method_call, |x| SubroutineCall::MethodCall(Box::new(x))),
|
||||||
@ -72,6 +78,7 @@ pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
|
pub(crate) fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
|
||||||
let (s, a) = opt(pair(keyword("std"), symbol("::")))(s)?;
|
let (s, a) = opt(pair(keyword("std"), symbol("::")))(s)?;
|
||||||
let (s, b) = randomize_call(s)?;
|
let (s, b) = randomize_call(s)?;
|
||||||
@ -82,17 +89,20 @@ pub(crate) fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
|
pub(crate) fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
|
||||||
map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s)
|
map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_arguments(s: Span) -> IResult<Span, ListOfArguments> {
|
pub(crate) fn list_of_arguments(s: Span) -> IResult<Span, ListOfArguments> {
|
||||||
alt((list_of_arguments_named, list_of_arguments_ordered))(s)
|
alt((list_of_arguments_named, list_of_arguments_ordered))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_arguments_ordered(s: Span) -> IResult<Span, ListOfArguments> {
|
pub(crate) fn list_of_arguments_ordered(s: Span) -> IResult<Span, ListOfArguments> {
|
||||||
let (s, a) = list(symbol(","), opt(expression))(s)?;
|
let (s, a) = list(symbol(","), opt(expression))(s)?;
|
||||||
let (s, b) = many0(tuple((
|
let (s, b) = many0(tuple((
|
||||||
@ -108,6 +118,7 @@ pub(crate) fn list_of_arguments_ordered(s: Span) -> IResult<Span, ListOfArgument
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
|
pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
|
||||||
let (s, a) = symbol(".")(s)?;
|
let (s, a) = symbol(".")(s)?;
|
||||||
let (s, b) = identifier(s)?;
|
let (s, b) = identifier(s)?;
|
||||||
@ -128,6 +139,7 @@ pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments>
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
|
pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
|
||||||
let (s, a) = method_call_root(s)?;
|
let (s, a) = method_call_root(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -137,6 +149,7 @@ pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
|
pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
|
||||||
alt((
|
alt((
|
||||||
method_call_body_user,
|
method_call_body_user,
|
||||||
@ -147,6 +160,7 @@ pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
|
pub(crate) fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
|
||||||
let (s, a) = method_identifier(s)?;
|
let (s, a) = method_identifier(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -158,6 +172,7 @@ pub(crate) fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
|
pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
|
||||||
alt((
|
alt((
|
||||||
map(array_manipulation_call, |x| {
|
map(array_manipulation_call, |x| {
|
||||||
@ -170,6 +185,7 @@ pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulationCall> {
|
pub(crate) fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulationCall> {
|
||||||
let (s, a) = array_method_name(s)?;
|
let (s, a) = array_method_name(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -184,6 +200,7 @@ pub(crate) fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
|
pub(crate) fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
|
||||||
let (s, a) = keyword("randomize")(s)?;
|
let (s, a) = keyword("randomize")(s)?;
|
||||||
let (s, b) = many0(attribute_instance)(s)?;
|
let (s, b) = many0(attribute_instance)(s)?;
|
||||||
@ -202,6 +219,7 @@ pub(crate) fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_identifier_list_or_null(
|
pub(crate) fn variable_identifier_list_or_null(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, VariableIdentifierListOrNull> {
|
) -> IResult<Span, VariableIdentifierListOrNull> {
|
||||||
@ -216,6 +234,7 @@ pub(crate) fn variable_identifier_list_or_null(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
|
pub(crate) fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
|
||||||
alt((
|
alt((
|
||||||
map(primary, |x| MethodCallRoot::Primary(Box::new(x))),
|
map(primary, |x| MethodCallRoot::Primary(Box::new(x))),
|
||||||
@ -226,6 +245,7 @@ pub(crate) fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn array_method_name(s: Span) -> IResult<Span, ArrayMethodName> {
|
pub(crate) fn array_method_name(s: Span) -> IResult<Span, ArrayMethodName> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("unique"), |x| ArrayMethodName::Unique(Box::new(x))),
|
map(keyword("unique"), |x| ArrayMethodName::Unique(Box::new(x))),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
|
pub(crate) fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
|
||||||
let (s, a) = symbol("(*")(s)?;
|
let (s, a) = symbol("(*")(s)?;
|
||||||
let (s, b) = list(symbol(","), attr_spec)(s)?;
|
let (s, b) = list(symbol(","), attr_spec)(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn attr_spec(s: Span) -> IResult<Span, AttrSpec> {
|
pub(crate) fn attr_spec(s: Span) -> IResult<Span, AttrSpec> {
|
||||||
let (s, a) = identifier(s)?;
|
let (s, a) = identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("="), constant_expression))(s)?;
|
let (s, b) = opt(pair(symbol("="), constant_expression))(s)?;
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn comment(s: Span) -> IResult<Span, Comment> {
|
pub(crate) fn comment(s: Span) -> IResult<Span, Comment> {
|
||||||
alt((one_line_comment, block_comment))(s)
|
alt((one_line_comment, block_comment))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
|
pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
|
||||||
let (s, a) = tag("//")(s)?;
|
let (s, a) = tag("//")(s)?;
|
||||||
let (s, b) = is_not("\n")(s)?;
|
let (s, b) = is_not("\n")(s)?;
|
||||||
@ -21,6 +23,7 @@ pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn block_comment(s: Span) -> IResult<Span, Comment> {
|
pub(crate) fn block_comment(s: Span) -> IResult<Span, Comment> {
|
||||||
let (s, a) = tag("/*")(s)?;
|
let (s, a) = tag("/*")(s)?;
|
||||||
let (s, b) = is_not("*/")(s)?;
|
let (s, b) = is_not("*/")(s)?;
|
||||||
|
@ -27,6 +27,7 @@ pub(crate) fn bin_identifier(s: Span) -> IResult<Span, BinIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
|
pub(crate) fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
|
||||||
let (s, a) = ws(c_identifier_impl)(s)?;
|
let (s, a) = ws(c_identifier_impl)(s)?;
|
||||||
Ok((s, CIdentifier { nodes: a }))
|
Ok((s, CIdentifier { nodes: a }))
|
||||||
@ -200,8 +201,8 @@ pub(crate) fn hierarchical_event_identifier(s: Span) -> IResult<Span, Hierarchic
|
|||||||
Ok((s, HierarchicalEventIdentifier { nodes: (a,) }))
|
Ok((s, HierarchicalEventIdentifier { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier> {
|
pub(crate) fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier> {
|
||||||
let (s, a) = opt(root)(s)?;
|
let (s, a) = opt(root)(s)?;
|
||||||
let (s, b) = many0(triple(identifier, constant_bit_select, symbol(".")))(s)?;
|
let (s, b) = many0(triple(identifier, constant_bit_select, symbol(".")))(s)?;
|
||||||
@ -210,6 +211,7 @@ pub(crate) fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIden
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn root(s: Span) -> IResult<Span, Root> {
|
pub(crate) fn root(s: Span) -> IResult<Span, Root> {
|
||||||
let (s, a) = keyword("$root")(s)?;
|
let (s, a) = keyword("$root")(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -266,8 +268,8 @@ pub(crate) fn hierarchical_variable_identifier(
|
|||||||
Ok((s, HierarchicalVariableIdentifier { nodes: (a,) }))
|
Ok((s, HierarchicalVariableIdentifier { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn identifier(s: Span) -> IResult<Span, Identifier> {
|
pub(crate) fn identifier(s: Span) -> IResult<Span, Identifier> {
|
||||||
alt((
|
alt((
|
||||||
map(escaped_identifier, |x| {
|
map(escaped_identifier, |x| {
|
||||||
@ -369,8 +371,8 @@ pub(crate) fn package_identifier(s: Span) -> IResult<Span, PackageIdentifier> {
|
|||||||
Ok((s, PackageIdentifier { nodes: (a,) }))
|
Ok((s, PackageIdentifier { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
|
pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
|
||||||
alt((
|
alt((
|
||||||
package_scope_package,
|
package_scope_package,
|
||||||
@ -379,6 +381,7 @@ pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
|
pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
|
||||||
let (s, a) = package_identifier(s)?;
|
let (s, a) = package_identifier(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
@ -389,6 +392,7 @@ pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn unit(s: Span) -> IResult<Span, Unit> {
|
pub(crate) fn unit(s: Span) -> IResult<Span, Unit> {
|
||||||
let (s, a) = keyword("$unit")(s)?;
|
let (s, a) = keyword("$unit")(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
@ -426,6 +430,7 @@ pub(crate) fn property_identifier(s: Span) -> IResult<Span, PropertyIdentifier>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_class_identifier(s: Span) -> IResult<Span, PsClassIdentifier> {
|
pub(crate) fn ps_class_identifier(s: Span) -> IResult<Span, PsClassIdentifier> {
|
||||||
let (s, a) = opt(package_scope)(s)?;
|
let (s, a) = opt(package_scope)(s)?;
|
||||||
let (s, b) = class_identifier(s)?;
|
let (s, b) = class_identifier(s)?;
|
||||||
@ -433,6 +438,7 @@ pub(crate) fn ps_class_identifier(s: Span) -> IResult<Span, PsClassIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_covergroup_identifier(s: Span) -> IResult<Span, PsCovergroupIdentifier> {
|
pub(crate) fn ps_covergroup_identifier(s: Span) -> IResult<Span, PsCovergroupIdentifier> {
|
||||||
let (s, a) = opt(package_scope)(s)?;
|
let (s, a) = opt(package_scope)(s)?;
|
||||||
let (s, b) = covergroup_identifier(s)?;
|
let (s, b) = covergroup_identifier(s)?;
|
||||||
@ -440,6 +446,7 @@ pub(crate) fn ps_covergroup_identifier(s: Span) -> IResult<Span, PsCovergroupIde
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_checker_identifier(s: Span) -> IResult<Span, PsCheckerIdentifier> {
|
pub(crate) fn ps_checker_identifier(s: Span) -> IResult<Span, PsCheckerIdentifier> {
|
||||||
let (s, a) = opt(package_scope)(s)?;
|
let (s, a) = opt(package_scope)(s)?;
|
||||||
let (s, b) = checker_identifier(s)?;
|
let (s, b) = checker_identifier(s)?;
|
||||||
@ -447,6 +454,7 @@ pub(crate) fn ps_checker_identifier(s: Span) -> IResult<Span, PsCheckerIdentifie
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_identifier(s: Span) -> IResult<Span, PsIdentifier> {
|
pub(crate) fn ps_identifier(s: Span) -> IResult<Span, PsIdentifier> {
|
||||||
let (s, a) = opt(package_scope)(s)?;
|
let (s, a) = opt(package_scope)(s)?;
|
||||||
let (s, b) = identifier(s)?;
|
let (s, b) = identifier(s)?;
|
||||||
@ -454,6 +462,7 @@ pub(crate) fn ps_identifier(s: Span) -> IResult<Span, PsIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_array_identifier(
|
pub(crate) fn ps_or_hierarchical_array_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalArrayIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalArrayIdentifier> {
|
||||||
@ -463,6 +472,7 @@ pub(crate) fn ps_or_hierarchical_array_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_net_identifier(
|
pub(crate) fn ps_or_hierarchical_net_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
|
||||||
@ -475,6 +485,7 @@ pub(crate) fn ps_or_hierarchical_net_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_net_identifier_package_scope(
|
pub(crate) fn ps_or_hierarchical_net_identifier_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
|
||||||
@ -489,6 +500,7 @@ pub(crate) fn ps_or_hierarchical_net_identifier_package_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_property_identifier(
|
pub(crate) fn ps_or_hierarchical_property_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
|
||||||
@ -501,6 +513,7 @@ pub(crate) fn ps_or_hierarchical_property_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_property_identifier_package_scope(
|
pub(crate) fn ps_or_hierarchical_property_identifier_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
|
||||||
@ -515,6 +528,7 @@ pub(crate) fn ps_or_hierarchical_property_identifier_package_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_sequence_identifier(
|
pub(crate) fn ps_or_hierarchical_sequence_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
|
||||||
@ -527,6 +541,7 @@ pub(crate) fn ps_or_hierarchical_sequence_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope(
|
pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
|
||||||
@ -541,6 +556,7 @@ pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_tf_identifier(
|
pub(crate) fn ps_or_hierarchical_tf_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
|
||||||
@ -553,6 +569,7 @@ pub(crate) fn ps_or_hierarchical_tf_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope(
|
pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
|
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
|
||||||
@ -566,8 +583,8 @@ pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope(
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
pub(crate) fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
||||||
alt((
|
alt((
|
||||||
ps_parameter_identifier_scope,
|
ps_parameter_identifier_scope,
|
||||||
@ -576,6 +593,7 @@ pub(crate) fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
pub(crate) fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
||||||
let (s, a) = opt(package_scope_or_class_scope)(s)?;
|
let (s, a) = opt(package_scope_or_class_scope)(s)?;
|
||||||
let (s, b) = parameter_identifier(s)?;
|
let (s, b) = parameter_identifier(s)?;
|
||||||
@ -586,6 +604,7 @@ pub(crate) fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParamete
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIdentifier> {
|
||||||
let (s, a) = many0(triple(
|
let (s, a) = many0(triple(
|
||||||
generate_block_identifier,
|
generate_block_identifier,
|
||||||
@ -599,8 +618,8 @@ pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParam
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[packrat_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ps_type_identifier(s: Span) -> IResult<Span, PsTypeIdentifier> {
|
pub(crate) fn ps_type_identifier(s: Span) -> IResult<Span, PsTypeIdentifier> {
|
||||||
let (s, a) = opt(local_or_package_scope_or_class_scope)(s)?;
|
let (s, a) = opt(local_or_package_scope_or_class_scope)(s)?;
|
||||||
let (s, b) = type_identifier(s)?;
|
let (s, b) = type_identifier(s)?;
|
||||||
@ -620,6 +639,7 @@ pub(crate) fn signal_identifier(s: Span) -> IResult<Span, SignalIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
|
pub(crate) fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
|
||||||
let (s, a) = ws(simple_identifier_impl)(s)?;
|
let (s, a) = ws(simple_identifier_impl)(s)?;
|
||||||
Ok((s, SimpleIdentifier { nodes: a }))
|
Ok((s, SimpleIdentifier { nodes: a }))
|
||||||
@ -648,6 +668,7 @@ pub(crate) fn specparam_identifier(s: Span) -> IResult<Span, SpecparamIdentifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_tf_identifier(s: Span) -> IResult<Span, SystemTfIdentifier> {
|
pub(crate) fn system_tf_identifier(s: Span) -> IResult<Span, SystemTfIdentifier> {
|
||||||
let (s, a) = ws(system_tf_identifier_impl)(s)?;
|
let (s, a) = ws(system_tf_identifier_impl)(s)?;
|
||||||
Ok((s, SystemTfIdentifier { nodes: a }))
|
Ok((s, SystemTfIdentifier { nodes: a }))
|
||||||
@ -705,6 +726,7 @@ pub(crate) fn variable_identifier(s: Span) -> IResult<Span, VariableIdentifier>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope(
|
pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ImplicitClassHandleOrClassScopeOrPackageScope> {
|
) -> IResult<Span, ImplicitClassHandleOrClassScopeOrPackageScope> {
|
||||||
@ -722,6 +744,7 @@ pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn implicit_class_handle_or_package_scope(
|
pub(crate) fn implicit_class_handle_or_package_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ImplicitClassHandleOrPackageScope> {
|
) -> IResult<Span, ImplicitClassHandleOrPackageScope> {
|
||||||
@ -736,6 +759,7 @@ pub(crate) fn implicit_class_handle_or_package_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn implicit_class_handle_or_class_scope(
|
pub(crate) fn implicit_class_handle_or_class_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ImplicitClassHandleOrClassScope> {
|
) -> IResult<Span, ImplicitClassHandleOrClassScope> {
|
||||||
@ -750,6 +774,7 @@ pub(crate) fn implicit_class_handle_or_class_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScopeOrClassScope> {
|
pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScopeOrClassScope> {
|
||||||
alt((
|
alt((
|
||||||
map(package_scope, |x| {
|
map(package_scope, |x| {
|
||||||
@ -762,6 +787,7 @@ pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScop
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn local_or_package_scope_or_class_scope(
|
pub(crate) fn local_or_package_scope_or_class_scope(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, LocalOrPackageScopeOrClassScope> {
|
) -> IResult<Span, LocalOrPackageScopeOrClassScope> {
|
||||||
@ -779,6 +805,7 @@ pub(crate) fn local_or_package_scope_or_class_scope(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn local(s: Span) -> IResult<Span, Local> {
|
pub(crate) fn local(s: Span) -> IResult<Span, Local> {
|
||||||
let (s, a) = keyword("local")(s)?;
|
let (s, a) = keyword("local")(s)?;
|
||||||
let (s, b) = symbol("::")(s)?;
|
let (s, b) = symbol("::")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
|
pub(crate) fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
|
||||||
let (s, a) = ps_checker_identifier(s)?;
|
let (s, a) = ps_checker_identifier(s)?;
|
||||||
let (s, b) = name_of_instance(s)?;
|
let (s, b) = name_of_instance(s)?;
|
||||||
@ -17,6 +18,7 @@ pub(crate) fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_checker_port_connections(
|
pub(crate) fn list_of_checker_port_connections(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfCheckerPortConnections> {
|
) -> IResult<Span, ListOfCheckerPortConnections> {
|
||||||
@ -28,6 +30,7 @@ pub(crate) fn list_of_checker_port_connections(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_checker_port_connections_ordered(
|
pub(crate) fn list_of_checker_port_connections_ordered(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfCheckerPortConnections> {
|
) -> IResult<Span, ListOfCheckerPortConnections> {
|
||||||
@ -41,6 +44,7 @@ pub(crate) fn list_of_checker_port_connections_ordered(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_checker_port_connections_named(
|
pub(crate) fn list_of_checker_port_connections_named(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfCheckerPortConnections> {
|
) -> IResult<Span, ListOfCheckerPortConnections> {
|
||||||
@ -55,6 +59,7 @@ pub(crate) fn list_of_checker_port_connections_named(
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ordered_checker_port_connection(
|
pub(crate) fn ordered_checker_port_connection(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, OrderedCheckerPortConnection> {
|
) -> IResult<Span, OrderedCheckerPortConnection> {
|
||||||
@ -64,6 +69,7 @@ pub(crate) fn ordered_checker_port_connection(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheckerPortConnection> {
|
pub(crate) fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheckerPortConnection> {
|
||||||
alt((
|
alt((
|
||||||
named_checker_port_connection_identifier,
|
named_checker_port_connection_identifier,
|
||||||
@ -72,6 +78,7 @@ pub(crate) fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheck
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_checker_port_connection_identifier(
|
pub(crate) fn named_checker_port_connection_identifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, NamedCheckerPortConnection> {
|
) -> IResult<Span, NamedCheckerPortConnection> {
|
||||||
@ -88,6 +95,7 @@ pub(crate) fn named_checker_port_connection_identifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_checker_port_connection_asterisk(
|
pub(crate) fn named_checker_port_connection_asterisk(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, NamedCheckerPortConnection> {
|
) -> IResult<Span, NamedCheckerPortConnection> {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
|
pub(crate) fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
|
||||||
let (s, a) = keyword("generate")(s)?;
|
let (s, a) = keyword("generate")(s)?;
|
||||||
let (s, b) = many0(generate_item)(s)?;
|
let (s, b) = many0(generate_item)(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct> {
|
pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct> {
|
||||||
let (s, a) = keyword("for")(s)?;
|
let (s, a) = keyword("for")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -25,6 +27,7 @@ pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateCons
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn generate_initialization(s: Span) -> IResult<Span, GenvarInitialization> {
|
pub(crate) fn generate_initialization(s: Span) -> IResult<Span, GenvarInitialization> {
|
||||||
let (s, a) = opt(map(keyword("genvar"), |x| Genvar { nodes: (x,) }))(s)?;
|
let (s, a) = opt(map(keyword("genvar"), |x| Genvar { nodes: (x,) }))(s)?;
|
||||||
let (s, b) = genvar_identifier(s)?;
|
let (s, b) = genvar_identifier(s)?;
|
||||||
@ -39,6 +42,7 @@ pub(crate) fn generate_initialization(s: Span) -> IResult<Span, GenvarInitializa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
|
pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
|
||||||
alt((
|
alt((
|
||||||
genvar_iteration_assignment,
|
genvar_iteration_assignment,
|
||||||
@ -48,6 +52,7 @@ pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
|
pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
|
||||||
let (s, a) = genvar_identifier(s)?;
|
let (s, a) = genvar_identifier(s)?;
|
||||||
let (s, b) = assignment_operator(s)?;
|
let (s, b) = assignment_operator(s)?;
|
||||||
@ -59,6 +64,7 @@ pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIterat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration> {
|
pub(crate) fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration> {
|
||||||
let (s, a) = inc_or_dec_operator(s)?;
|
let (s, a) = inc_or_dec_operator(s)?;
|
||||||
let (s, b) = genvar_identifier(s)?;
|
let (s, b) = genvar_identifier(s)?;
|
||||||
@ -69,6 +75,7 @@ pub(crate) fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration> {
|
pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration> {
|
||||||
let (s, a) = genvar_identifier(s)?;
|
let (s, a) = genvar_identifier(s)?;
|
||||||
let (s, b) = inc_or_dec_operator(s)?;
|
let (s, b) = inc_or_dec_operator(s)?;
|
||||||
@ -79,6 +86,7 @@ pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn conditional_generate_construct(
|
pub(crate) fn conditional_generate_construct(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConditionalGenerateConstruct> {
|
) -> IResult<Span, ConditionalGenerateConstruct> {
|
||||||
@ -93,6 +101,7 @@ pub(crate) fn conditional_generate_construct(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
|
pub(crate) fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
|
||||||
let (s, a) = keyword("if")(s)?;
|
let (s, a) = keyword("if")(s)?;
|
||||||
let (s, b) = paren(constant_expression)(s)?;
|
let (s, b) = paren(constant_expression)(s)?;
|
||||||
@ -107,6 +116,7 @@ pub(crate) fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruc
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct> {
|
pub(crate) fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct> {
|
||||||
let (s, a) = keyword("case")(s)?;
|
let (s, a) = keyword("case")(s)?;
|
||||||
let (s, b) = paren(constant_expression)(s)?;
|
let (s, b) = paren(constant_expression)(s)?;
|
||||||
@ -121,12 +131,14 @@ pub(crate) fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateCons
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_generate_item(s: Span) -> IResult<Span, CaseGenerateItem> {
|
pub(crate) fn case_generate_item(s: Span) -> IResult<Span, CaseGenerateItem> {
|
||||||
alt((case_generate_item_nondefault, case_generate_item_default))(s)
|
alt((case_generate_item_nondefault, case_generate_item_default))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_generate_item_nondefault(s: Span) -> IResult<Span, CaseGenerateItem> {
|
pub(crate) fn case_generate_item_nondefault(s: Span) -> IResult<Span, CaseGenerateItem> {
|
||||||
let (s, a) = list(symbol(","), constant_expression)(s)?;
|
let (s, a) = list(symbol(","), constant_expression)(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -138,6 +150,7 @@ pub(crate) fn case_generate_item_nondefault(s: Span) -> IResult<Span, CaseGenera
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
|
pub(crate) fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
let (s, b) = opt(symbol(":"))(s)?;
|
let (s, b) = opt(symbol(":"))(s)?;
|
||||||
@ -149,6 +162,7 @@ pub(crate) fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateI
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
|
pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
|
||||||
alt((
|
alt((
|
||||||
map(generate_item, |x| GenerateBlock::GenerateItem(Box::new(x))),
|
map(generate_item, |x| GenerateBlock::GenerateItem(Box::new(x))),
|
||||||
@ -157,6 +171,7 @@ pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
|
pub(crate) fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
|
||||||
let (s, a) = opt(pair(generate_block_identifier, symbol(":")))(s)?;
|
let (s, a) = opt(pair(generate_block_identifier, symbol(":")))(s)?;
|
||||||
let (s, b) = keyword("begin")(s)?;
|
let (s, b) = keyword("begin")(s)?;
|
||||||
@ -173,6 +188,7 @@ pub(crate) fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn generate_item(s: Span) -> IResult<Span, GenerateItem> {
|
pub(crate) fn generate_item(s: Span) -> IResult<Span, GenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
map(module_or_generate_item, |x| {
|
map(module_or_generate_item, |x| {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_instantiation(s: Span) -> IResult<Span, InterfaceInstantiation> {
|
pub(crate) fn interface_instantiation(s: Span) -> IResult<Span, InterfaceInstantiation> {
|
||||||
let (s, a) = interface_identifier(s)?;
|
let (s, a) = interface_identifier(s)?;
|
||||||
let (s, b) = opt(parameter_value_assignment)(s)?;
|
let (s, b) = opt(parameter_value_assignment)(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
|
pub(crate) fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
|
||||||
let (s, a) = module_identifier(s)?;
|
let (s, a) = module_identifier(s)?;
|
||||||
let (s, b) = opt(parameter_value_assignment)(s)?;
|
let (s, b) = opt(parameter_value_assignment)(s)?;
|
||||||
@ -17,6 +18,7 @@ pub(crate) fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_value_assignment(s: Span) -> IResult<Span, ParameterValueAssignment> {
|
pub(crate) fn parameter_value_assignment(s: Span) -> IResult<Span, ParameterValueAssignment> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(opt(list_of_parameter_assignments))(s)?;
|
let (s, b) = paren(opt(list_of_parameter_assignments))(s)?;
|
||||||
@ -24,6 +26,7 @@ pub(crate) fn parameter_value_assignment(s: Span) -> IResult<Span, ParameterValu
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfParameterAssignments> {
|
pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfParameterAssignments> {
|
||||||
alt((
|
alt((
|
||||||
list_of_parameter_assignments_named,
|
list_of_parameter_assignments_named,
|
||||||
@ -33,6 +36,7 @@ pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfPara
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_parameter_assignments_ordered(
|
pub(crate) fn list_of_parameter_assignments_ordered(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfParameterAssignments> {
|
) -> IResult<Span, ListOfParameterAssignments> {
|
||||||
@ -46,6 +50,7 @@ pub(crate) fn list_of_parameter_assignments_ordered(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_parameter_assignments_named(
|
pub(crate) fn list_of_parameter_assignments_named(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ListOfParameterAssignments> {
|
) -> IResult<Span, ListOfParameterAssignments> {
|
||||||
@ -59,12 +64,14 @@ pub(crate) fn list_of_parameter_assignments_named(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ordered_parameter_assignment(s: Span) -> IResult<Span, OrderedParameterAssignment> {
|
pub(crate) fn ordered_parameter_assignment(s: Span) -> IResult<Span, OrderedParameterAssignment> {
|
||||||
let (s, x) = param_expression(s)?;
|
let (s, x) = param_expression(s)?;
|
||||||
Ok((s, OrderedParameterAssignment { nodes: (x,) }))
|
Ok((s, OrderedParameterAssignment { nodes: (x,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssignment> {
|
pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssignment> {
|
||||||
let (s, a) = symbol(".")(s)?;
|
let (s, a) = symbol(".")(s)?;
|
||||||
let (s, b) = parameter_identifier(s)?;
|
let (s, b) = parameter_identifier(s)?;
|
||||||
@ -73,6 +80,7 @@ pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParamete
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hierarchical_instance(s: Span) -> IResult<Span, HierarchicalInstance> {
|
pub(crate) fn hierarchical_instance(s: Span) -> IResult<Span, HierarchicalInstance> {
|
||||||
let (s, a) = name_of_instance(s)?;
|
let (s, a) = name_of_instance(s)?;
|
||||||
let (s, b) = paren(opt(list_of_port_connections))(s)?;
|
let (s, b) = paren(opt(list_of_port_connections))(s)?;
|
||||||
@ -80,6 +88,7 @@ pub(crate) fn hierarchical_instance(s: Span) -> IResult<Span, HierarchicalInstan
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn name_of_instance(s: Span) -> IResult<Span, NameOfInstance> {
|
pub(crate) fn name_of_instance(s: Span) -> IResult<Span, NameOfInstance> {
|
||||||
let (s, x) = instance_identifier(s)?;
|
let (s, x) = instance_identifier(s)?;
|
||||||
let (s, y) = many0(unpacked_dimension)(s)?;
|
let (s, y) = many0(unpacked_dimension)(s)?;
|
||||||
@ -87,6 +96,7 @@ pub(crate) fn name_of_instance(s: Span) -> IResult<Span, NameOfInstance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConnections> {
|
pub(crate) fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConnections> {
|
||||||
alt((
|
alt((
|
||||||
list_of_port_connections_named,
|
list_of_port_connections_named,
|
||||||
@ -96,6 +106,7 @@ pub(crate) fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConne
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConnections> {
|
pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConnections> {
|
||||||
let (s, a) = list(symbol(","), ordered_port_connection)(s)?;
|
let (s, a) = list(symbol(","), ordered_port_connection)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -105,6 +116,7 @@ pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnections> {
|
pub(crate) fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnections> {
|
||||||
let (s, a) = list(symbol(","), named_port_connection)(s)?;
|
let (s, a) = list(symbol(","), named_port_connection)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -115,6 +127,7 @@ pub(crate) fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPor
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ordered_port_connection(s: Span) -> IResult<Span, OrderedPortConnection> {
|
pub(crate) fn ordered_port_connection(s: Span) -> IResult<Span, OrderedPortConnection> {
|
||||||
let (s, x) = many0(attribute_instance)(s)?;
|
let (s, x) = many0(attribute_instance)(s)?;
|
||||||
let (s, y) = opt(expression)(s)?;
|
let (s, y) = opt(expression)(s)?;
|
||||||
@ -122,6 +135,7 @@ pub(crate) fn ordered_port_connection(s: Span) -> IResult<Span, OrderedPortConne
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnection> {
|
pub(crate) fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnection> {
|
||||||
alt((
|
alt((
|
||||||
named_port_connection_identifier,
|
named_port_connection_identifier,
|
||||||
@ -130,6 +144,7 @@ pub(crate) fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnectio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConnection> {
|
pub(crate) fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConnection> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -144,6 +159,7 @@ pub(crate) fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPo
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn named_port_connection_asterisk(s: Span) -> IResult<Span, NamedPortConnection> {
|
pub(crate) fn named_port_connection_asterisk(s: Span) -> IResult<Span, NamedPortConnection> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = symbol(".*")(s)?;
|
let (s, b) = symbol(".*")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_instantiation(s: Span) -> IResult<Span, ProgramInstantiation> {
|
pub(crate) fn program_instantiation(s: Span) -> IResult<Span, ProgramInstantiation> {
|
||||||
let (s, a) = program_identifier(s)?;
|
let (s, a) = program_identifier(s)?;
|
||||||
let (s, b) = opt(parameter_value_assignment)(s)?;
|
let (s, b) = opt(parameter_value_assignment)(s)?;
|
||||||
|
@ -72,21 +72,21 @@ impl HasTracableInfo for SpanInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HasExtraState<RecursiveInfo> for SpanInfo {
|
//impl HasExtraState<RecursiveInfo> for SpanInfo {
|
||||||
fn get_extra_state(&self) -> RecursiveInfo {
|
// fn get_extra_state(&self) -> RecursiveInfo {
|
||||||
self.recursive_info
|
// self.recursive_info
|
||||||
}
|
|
||||||
}
|
|
||||||
//impl HasExtraState<()> for SpanInfo {
|
|
||||||
// fn get_extra_state(&self) -> () {
|
|
||||||
// ()
|
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
impl HasExtraState<()> for SpanInfo {
|
||||||
|
fn get_extra_state(&self) -> () {
|
||||||
|
()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
nom_packrat::storage!(AnyNode, RecursiveInfo);
|
//nom_packrat::storage!(AnyNode, RecursiveInfo);
|
||||||
//nom_packrat::storage!(AnyNode);
|
nom_packrat::storage!(AnyNode);
|
||||||
|
|
||||||
pub fn parse_sv(s: &str) -> Result<SourceText, ()> {
|
pub fn parse_sv(s: &str) -> Result<SourceText, ()> {
|
||||||
let s = Span::new_extra(s, SpanInfo::default());
|
let s = Span::new_extra(s, SpanInfo::default());
|
||||||
|
@ -3,12 +3,14 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cmos_switchtype(s: Span) -> IResult<Span, CmosSwitchtype> {
|
pub(crate) fn cmos_switchtype(s: Span) -> IResult<Span, CmosSwitchtype> {
|
||||||
let (s, a) = alt((keyword("cmos"), keyword("rcmos")))(s)?;
|
let (s, a) = alt((keyword("cmos"), keyword("rcmos")))(s)?;
|
||||||
Ok((s, CmosSwitchtype { nodes: (a,) }))
|
Ok((s, CmosSwitchtype { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
|
pub(crate) fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
keyword("bufif0"),
|
keyword("bufif0"),
|
||||||
@ -20,6 +22,7 @@ pub(crate) fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
|
pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
keyword("nmos"),
|
keyword("nmos"),
|
||||||
@ -31,6 +34,7 @@ pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
|
pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
keyword("and"),
|
keyword("and"),
|
||||||
@ -44,12 +48,14 @@ pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn n_output_gatetype(s: Span) -> IResult<Span, NOutputGatetype> {
|
pub(crate) fn n_output_gatetype(s: Span) -> IResult<Span, NOutputGatetype> {
|
||||||
let (s, a) = alt((keyword("buf"), keyword("not")))(s)?;
|
let (s, a) = alt((keyword("buf"), keyword("not")))(s)?;
|
||||||
Ok((s, NOutputGatetype { nodes: (a,) }))
|
Ok((s, NOutputGatetype { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
|
pub(crate) fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
keyword("tranif0"),
|
keyword("tranif0"),
|
||||||
@ -61,6 +67,7 @@ pub(crate) fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pass_switchtype(s: Span) -> IResult<Span, PassSwitchtype> {
|
pub(crate) fn pass_switchtype(s: Span) -> IResult<Span, PassSwitchtype> {
|
||||||
let (s, a) = alt((keyword("tran"), keyword("rtran")))(s)?;
|
let (s, a) = alt((keyword("tran"), keyword("rtran")))(s)?;
|
||||||
Ok((s, PassSwitchtype { nodes: (a,) }))
|
Ok((s, PassSwitchtype { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
alt((
|
alt((
|
||||||
gate_instantiation_cmos,
|
gate_instantiation_cmos,
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = cmos_switchtype(s)?;
|
let (s, a) = cmos_switchtype(s)?;
|
||||||
let (s, b) = opt(delay3)(s)?;
|
let (s, b) = opt(delay3)(s)?;
|
||||||
@ -32,6 +34,7 @@ pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = enable_gatetype(s)?;
|
let (s, a) = enable_gatetype(s)?;
|
||||||
let (s, b) = opt(drive_strength)(s)?;
|
let (s, b) = opt(drive_strength)(s)?;
|
||||||
@ -47,6 +50,7 @@ pub(crate) fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = mos_switchtype(s)?;
|
let (s, a) = mos_switchtype(s)?;
|
||||||
let (s, b) = opt(delay3)(s)?;
|
let (s, b) = opt(delay3)(s)?;
|
||||||
@ -61,6 +65,7 @@ pub(crate) fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = n_input_gatetype(s)?;
|
let (s, a) = n_input_gatetype(s)?;
|
||||||
let (s, b) = opt(drive_strength)(s)?;
|
let (s, b) = opt(drive_strength)(s)?;
|
||||||
@ -76,6 +81,7 @@ pub(crate) fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantia
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = n_output_gatetype(s)?;
|
let (s, a) = n_output_gatetype(s)?;
|
||||||
let (s, b) = opt(drive_strength)(s)?;
|
let (s, b) = opt(drive_strength)(s)?;
|
||||||
@ -91,6 +97,7 @@ pub(crate) fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstanti
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = pass_en_switchtype(s)?;
|
let (s, a) = pass_en_switchtype(s)?;
|
||||||
let (s, b) = opt(delay2)(s)?;
|
let (s, b) = opt(delay2)(s)?;
|
||||||
@ -105,6 +112,7 @@ pub(crate) fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantia
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = pass_switchtype(s)?;
|
let (s, a) = pass_switchtype(s)?;
|
||||||
let (s, b) = list(symbol(","), pass_switch_instance)(s)?;
|
let (s, b) = list(symbol(","), pass_switch_instance)(s)?;
|
||||||
@ -116,6 +124,7 @@ pub(crate) fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = keyword("pulldown")(s)?;
|
let (s, a) = keyword("pulldown")(s)?;
|
||||||
let (s, b) = opt(pulldown_strength)(s)?;
|
let (s, b) = opt(pulldown_strength)(s)?;
|
||||||
@ -130,6 +139,7 @@ pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstanti
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
|
pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
|
||||||
let (s, a) = keyword("pullup")(s)?;
|
let (s, a) = keyword("pullup")(s)?;
|
||||||
let (s, b) = opt(pullup_strength)(s)?;
|
let (s, b) = opt(pullup_strength)(s)?;
|
||||||
@ -144,6 +154,7 @@ pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
|
pub(crate) fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -159,6 +170,7 @@ pub(crate) fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
|
pub(crate) fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -172,6 +184,7 @@ pub(crate) fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
|
pub(crate) fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -185,6 +198,7 @@ pub(crate) fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance> {
|
pub(crate) fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -196,6 +210,7 @@ pub(crate) fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstance> {
|
pub(crate) fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -210,6 +225,7 @@ pub(crate) fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstan
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pass_switch_instance(s: Span) -> IResult<Span, PassSwitchInstance> {
|
pub(crate) fn pass_switch_instance(s: Span) -> IResult<Span, PassSwitchInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((inout_terminal, symbol(","), inout_terminal)))(s)?;
|
let (s, b) = paren(tuple((inout_terminal, symbol(","), inout_terminal)))(s)?;
|
||||||
@ -217,6 +233,7 @@ pub(crate) fn pass_switch_instance(s: Span) -> IResult<Span, PassSwitchInstance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pass_enable_switch_instance(s: Span) -> IResult<Span, PassEnableSwitchInstance> {
|
pub(crate) fn pass_enable_switch_instance(s: Span) -> IResult<Span, PassEnableSwitchInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -230,6 +247,7 @@ pub(crate) fn pass_enable_switch_instance(s: Span) -> IResult<Span, PassEnableSw
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pull_gate_instance(s: Span) -> IResult<Span, PullGateInstance> {
|
pub(crate) fn pull_gate_instance(s: Span) -> IResult<Span, PullGateInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(output_terminal)(s)?;
|
let (s, b) = paren(output_terminal)(s)?;
|
||||||
|
@ -3,11 +3,13 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulldown_strength(s: Span) -> IResult<Span, PulldownStrength> {
|
pub(crate) fn pulldown_strength(s: Span) -> IResult<Span, PulldownStrength> {
|
||||||
alt((pulldown_strength01, pulldown_strength10, pulldown_strength0))(s)
|
alt((pulldown_strength01, pulldown_strength10, pulldown_strength0))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
|
pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
|
||||||
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -17,6 +19,7 @@ pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
|
pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
|
||||||
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -26,6 +29,7 @@ pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
|
pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
|
||||||
let (s, a) = paren(strength0)(s)?;
|
let (s, a) = paren(strength0)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -35,11 +39,13 @@ pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pullup_strength(s: Span) -> IResult<Span, PullupStrength> {
|
pub(crate) fn pullup_strength(s: Span) -> IResult<Span, PullupStrength> {
|
||||||
alt((pullup_strength01, pullup_strength10, pullup_strength1))(s)
|
alt((pullup_strength01, pullup_strength10, pullup_strength1))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
|
pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
|
||||||
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -49,6 +55,7 @@ pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
|
pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
|
||||||
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -58,6 +65,7 @@ pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pullup_strength1(s: Span) -> IResult<Span, PullupStrength> {
|
pub(crate) fn pullup_strength1(s: Span) -> IResult<Span, PullupStrength> {
|
||||||
let (s, a) = paren(strength1)(s)?;
|
let (s, a) = paren(strength1)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
|
@ -3,36 +3,42 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn enable_terminal(s: Span) -> IResult<Span, EnableTerminal> {
|
pub(crate) fn enable_terminal(s: Span) -> IResult<Span, EnableTerminal> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, EnableTerminal { nodes: (a,) }))
|
Ok((s, EnableTerminal { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inout_terminal(s: Span) -> IResult<Span, InoutTerminal> {
|
pub(crate) fn inout_terminal(s: Span) -> IResult<Span, InoutTerminal> {
|
||||||
let (s, a) = net_lvalue(s)?;
|
let (s, a) = net_lvalue(s)?;
|
||||||
Ok((s, InoutTerminal { nodes: (a,) }))
|
Ok((s, InoutTerminal { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_terminal(s: Span) -> IResult<Span, InputTerminal> {
|
pub(crate) fn input_terminal(s: Span) -> IResult<Span, InputTerminal> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, InputTerminal { nodes: (a,) }))
|
Ok((s, InputTerminal { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ncontrol_terminal(s: Span) -> IResult<Span, NcontrolTerminal> {
|
pub(crate) fn ncontrol_terminal(s: Span) -> IResult<Span, NcontrolTerminal> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, NcontrolTerminal { nodes: (a,) }))
|
Ok((s, NcontrolTerminal { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_terminal(s: Span) -> IResult<Span, OutputTerminal> {
|
pub(crate) fn output_terminal(s: Span) -> IResult<Span, OutputTerminal> {
|
||||||
let (s, a) = net_lvalue(s)?;
|
let (s, a) = net_lvalue(s)?;
|
||||||
Ok((s, OutputTerminal { nodes: (a,) }))
|
Ok((s, OutputTerminal { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pcontrol_terminal(s: Span) -> IResult<Span, PcontrolTerminal> {
|
pub(crate) fn pcontrol_terminal(s: Span) -> IResult<Span, PcontrolTerminal> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, PcontrolTerminal { nodes: (a,) }))
|
Ok((s, PcontrolTerminal { nodes: (a,) }))
|
||||||
|
@ -3,12 +3,14 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_port_list(s: Span) -> IResult<Span, CheckerPortList> {
|
pub(crate) fn checker_port_list(s: Span) -> IResult<Span, CheckerPortList> {
|
||||||
let (s, a) = list(symbol(","), checker_port_item)(s)?;
|
let (s, a) = list(symbol(","), checker_port_item)(s)?;
|
||||||
Ok((s, CheckerPortList { nodes: (a,) }))
|
Ok((s, CheckerPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_port_item(s: Span) -> IResult<Span, CheckerPortItem> {
|
pub(crate) fn checker_port_item(s: Span) -> IResult<Span, CheckerPortItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = opt(checker_port_direction)(s)?;
|
let (s, b) = opt(checker_port_direction)(s)?;
|
||||||
@ -25,6 +27,7 @@ pub(crate) fn checker_port_item(s: Span) -> IResult<Span, CheckerPortItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
|
pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("input"), |x| {
|
map(keyword("input"), |x| {
|
||||||
@ -37,6 +40,7 @@ pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirect
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem> {
|
pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
map(checker_or_generate_item_declaration, |x| {
|
map(checker_or_generate_item_declaration, |x| {
|
||||||
@ -64,6 +68,7 @@ pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenera
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_or_generate_item_declaration(
|
pub(crate) fn checker_or_generate_item_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
||||||
@ -96,6 +101,7 @@ pub(crate) fn checker_or_generate_item_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_or_generate_item_declaration_data(
|
pub(crate) fn checker_or_generate_item_declaration_data(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
||||||
@ -110,12 +116,14 @@ pub(crate) fn checker_or_generate_item_declaration_data(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn rand(s: Span) -> IResult<Span, Rand> {
|
pub(crate) fn rand(s: Span) -> IResult<Span, Rand> {
|
||||||
let (s, a) = keyword("rand")(s)?;
|
let (s, a) = keyword("rand")(s)?;
|
||||||
Ok((s, Rand { nodes: (a,) }))
|
Ok((s, Rand { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_or_generate_item_declaration_clocking(
|
pub(crate) fn checker_or_generate_item_declaration_clocking(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
||||||
@ -134,6 +142,7 @@ pub(crate) fn checker_or_generate_item_declaration_clocking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_or_generate_item_declaration_disable(
|
pub(crate) fn checker_or_generate_item_declaration_disable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
|
||||||
@ -153,6 +162,7 @@ pub(crate) fn checker_or_generate_item_declaration_disable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_generate_item(s: Span) -> IResult<Span, CheckerGenerateItem> {
|
pub(crate) fn checker_generate_item(s: Span) -> IResult<Span, CheckerGenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
map(loop_generate_construct, |x| {
|
map(loop_generate_construct, |x| {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
|
||||||
alt((
|
alt((
|
||||||
class_item_property,
|
class_item_property,
|
||||||
@ -21,6 +22,7 @@ pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = class_property(s)?;
|
let (s, b) = class_property(s)?;
|
||||||
@ -31,6 +33,7 @@ pub(crate) fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = class_method(s)?;
|
let (s, b) = class_method(s)?;
|
||||||
@ -41,6 +44,7 @@ pub(crate) fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = class_constraint(s)?;
|
let (s, b) = class_constraint(s)?;
|
||||||
@ -51,6 +55,7 @@ pub(crate) fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = class_declaration(s)?;
|
let (s, b) = class_declaration(s)?;
|
||||||
@ -61,6 +66,7 @@ pub(crate) fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
|
pub(crate) fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = covergroup_declaration(s)?;
|
let (s, b) = covergroup_declaration(s)?;
|
||||||
@ -71,11 +77,13 @@ pub(crate) fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_property(s: Span) -> IResult<Span, ClassProperty> {
|
pub(crate) fn class_property(s: Span) -> IResult<Span, ClassProperty> {
|
||||||
alt((class_property_non_const, class_property_const))(s)
|
alt((class_property_non_const, class_property_const))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty> {
|
pub(crate) fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty> {
|
||||||
let (s, a) = many0(property_qualifier)(s)?;
|
let (s, a) = many0(property_qualifier)(s)?;
|
||||||
let (s, b) = data_declaration(s)?;
|
let (s, b) = data_declaration(s)?;
|
||||||
@ -86,6 +94,7 @@ pub(crate) fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
|
pub(crate) fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
|
||||||
let (s, a) = keyword("const")(s)?;
|
let (s, a) = keyword("const")(s)?;
|
||||||
let (s, b) = many0(class_item_qualifier)(s)?;
|
let (s, b) = many0(class_item_qualifier)(s)?;
|
||||||
@ -102,6 +111,7 @@ pub(crate) fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
alt((
|
alt((
|
||||||
class_method_task,
|
class_method_task,
|
||||||
@ -114,6 +124,7 @@ pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = many0(method_qualifier)(s)?;
|
let (s, a) = many0(method_qualifier)(s)?;
|
||||||
let (s, b) = task_declaration(s)?;
|
let (s, b) = task_declaration(s)?;
|
||||||
@ -124,6 +135,7 @@ pub(crate) fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = many0(method_qualifier)(s)?;
|
let (s, a) = many0(method_qualifier)(s)?;
|
||||||
let (s, b) = function_declaration(s)?;
|
let (s, b) = function_declaration(s)?;
|
||||||
@ -134,6 +146,7 @@ pub(crate) fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = keyword("pure")(s)?;
|
let (s, a) = keyword("pure")(s)?;
|
||||||
let (s, b) = keyword("virtual")(s)?;
|
let (s, b) = keyword("virtual")(s)?;
|
||||||
@ -149,6 +162,7 @@ pub(crate) fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = many0(method_qualifier)(s)?;
|
let (s, b) = many0(method_qualifier)(s)?;
|
||||||
@ -163,6 +177,7 @@ pub(crate) fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = many0(method_qualifier)(s)?;
|
let (s, a) = many0(method_qualifier)(s)?;
|
||||||
let (s, b) = class_constructor_declaration(s)?;
|
let (s, b) = class_constructor_declaration(s)?;
|
||||||
@ -173,6 +188,7 @@ pub(crate) fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMethod> {
|
pub(crate) fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMethod> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = many0(method_qualifier)(s)?;
|
let (s, b) = many0(method_qualifier)(s)?;
|
||||||
@ -184,6 +200,7 @@ pub(crate) fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMet
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPrototype> {
|
pub(crate) fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPrototype> {
|
||||||
let (s, a) = keyword("function")(s)?;
|
let (s, a) = keyword("function")(s)?;
|
||||||
let (s, b) = keyword("new")(s)?;
|
let (s, b) = keyword("new")(s)?;
|
||||||
@ -198,6 +215,7 @@ pub(crate) fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstru
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
|
pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
|
||||||
alt((
|
alt((
|
||||||
map(constraint_prototype, |x| {
|
map(constraint_prototype, |x| {
|
||||||
@ -210,6 +228,7 @@ pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
|
pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("static"), |x| {
|
map(keyword("static"), |x| {
|
||||||
@ -223,6 +242,7 @@ pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
|
pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
|
||||||
alt((
|
alt((
|
||||||
map(random_qualifier, |x| {
|
map(random_qualifier, |x| {
|
||||||
@ -235,6 +255,7 @@ pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
|
pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("randc"), |x| RandomQualifier::Randc(Box::new(x))),
|
map(keyword("randc"), |x| RandomQualifier::Randc(Box::new(x))),
|
||||||
@ -243,6 +264,7 @@ pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
|
pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(keyword("pure"), keyword("virtual")), |x| {
|
map(pair(keyword("pure"), keyword("virtual")), |x| {
|
||||||
@ -258,6 +280,7 @@ pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
|
pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
|
||||||
alt((
|
alt((
|
||||||
map(task_prototype, |x| {
|
map(task_prototype, |x| {
|
||||||
@ -270,6 +293,7 @@ pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorDeclaration> {
|
pub(crate) fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorDeclaration> {
|
||||||
let (s, a) = keyword("function")(s)?;
|
let (s, a) = keyword("function")(s)?;
|
||||||
let (s, b) = opt(class_scope)(s)?;
|
let (s, b) = opt(class_scope)(s)?;
|
||||||
@ -296,6 +320,7 @@ pub(crate) fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConst
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn new(s: Span) -> IResult<Span, New> {
|
pub(crate) fn new(s: Span) -> IResult<Span, New> {
|
||||||
let (s, a) = keyword("new")(s)?;
|
let (s, a) = keyword("new")(s)?;
|
||||||
Ok((s, New { nodes: (a,) }))
|
Ok((s, New { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
|
pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
|
||||||
let (s, a) = keyword("config")(s)?;
|
let (s, a) = keyword("config")(s)?;
|
||||||
let (s, b) = config_identifier(s)?;
|
let (s, b) = config_identifier(s)?;
|
||||||
@ -21,6 +22,7 @@ pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
|
pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
|
||||||
let (s, a) = keyword("design")(s)?;
|
let (s, a) = keyword("design")(s)?;
|
||||||
let (s, b) = many0(pair(
|
let (s, b) = many0(pair(
|
||||||
@ -32,6 +34,7 @@ pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
alt((
|
alt((
|
||||||
config_rule_statement_default,
|
config_rule_statement_default,
|
||||||
@ -43,6 +46,7 @@ pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
let (s, a) = default_clause(s)?;
|
let (s, a) = default_clause(s)?;
|
||||||
let (s, b) = liblist_clause(s)?;
|
let (s, b) = liblist_clause(s)?;
|
||||||
@ -54,6 +58,7 @@ pub(crate) fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRule
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
let (s, a) = inst_clause(s)?;
|
let (s, a) = inst_clause(s)?;
|
||||||
let (s, b) = liblist_clause(s)?;
|
let (s, b) = liblist_clause(s)?;
|
||||||
@ -65,6 +70,7 @@ pub(crate) fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRul
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
let (s, a) = inst_clause(s)?;
|
let (s, a) = inst_clause(s)?;
|
||||||
let (s, b) = use_clause(s)?;
|
let (s, b) = use_clause(s)?;
|
||||||
@ -76,6 +82,7 @@ pub(crate) fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRul
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
let (s, a) = cell_clause(s)?;
|
let (s, a) = cell_clause(s)?;
|
||||||
let (s, b) = liblist_clause(s)?;
|
let (s, b) = liblist_clause(s)?;
|
||||||
@ -87,6 +94,7 @@ pub(crate) fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRul
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
pub(crate) fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
|
||||||
let (s, a) = cell_clause(s)?;
|
let (s, a) = cell_clause(s)?;
|
||||||
let (s, b) = use_clause(s)?;
|
let (s, b) = use_clause(s)?;
|
||||||
@ -98,12 +106,14 @@ pub(crate) fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRul
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn default_clause(s: Span) -> IResult<Span, DefaultClause> {
|
pub(crate) fn default_clause(s: Span) -> IResult<Span, DefaultClause> {
|
||||||
let (s, a) = keyword("default")(s)?;
|
let (s, a) = keyword("default")(s)?;
|
||||||
Ok((s, DefaultClause { nodes: (a,) }))
|
Ok((s, DefaultClause { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inst_clause(s: Span) -> IResult<Span, InstClause> {
|
pub(crate) fn inst_clause(s: Span) -> IResult<Span, InstClause> {
|
||||||
let (s, a) = keyword("instance")(s)?;
|
let (s, a) = keyword("instance")(s)?;
|
||||||
let (s, b) = inst_name(s)?;
|
let (s, b) = inst_name(s)?;
|
||||||
@ -111,6 +121,7 @@ pub(crate) fn inst_clause(s: Span) -> IResult<Span, InstClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn inst_name(s: Span) -> IResult<Span, InstName> {
|
pub(crate) fn inst_name(s: Span) -> IResult<Span, InstName> {
|
||||||
let (s, a) = topmodule_identifier(s)?;
|
let (s, a) = topmodule_identifier(s)?;
|
||||||
let (s, b) = many0(pair(symbol("."), instance_identifier))(s)?;
|
let (s, b) = many0(pair(symbol("."), instance_identifier))(s)?;
|
||||||
@ -118,6 +129,7 @@ pub(crate) fn inst_name(s: Span) -> IResult<Span, InstName> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn cell_clause(s: Span) -> IResult<Span, CellClause> {
|
pub(crate) fn cell_clause(s: Span) -> IResult<Span, CellClause> {
|
||||||
let (s, a) = keyword("cell")(s)?;
|
let (s, a) = keyword("cell")(s)?;
|
||||||
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
||||||
@ -126,6 +138,7 @@ pub(crate) fn cell_clause(s: Span) -> IResult<Span, CellClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn liblist_clause(s: Span) -> IResult<Span, LiblistClause> {
|
pub(crate) fn liblist_clause(s: Span) -> IResult<Span, LiblistClause> {
|
||||||
let (s, a) = keyword("liblist")(s)?;
|
let (s, a) = keyword("liblist")(s)?;
|
||||||
let (s, b) = many0(library_identifier)(s)?;
|
let (s, b) = many0(library_identifier)(s)?;
|
||||||
@ -133,11 +146,13 @@ pub(crate) fn liblist_clause(s: Span) -> IResult<Span, LiblistClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn use_clause(s: Span) -> IResult<Span, UseClause> {
|
pub(crate) fn use_clause(s: Span) -> IResult<Span, UseClause> {
|
||||||
alt((use_clause_cell, use_clause_named, use_clause_cell_named))(s)
|
alt((use_clause_cell, use_clause_named, use_clause_cell_named))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
|
pub(crate) fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
|
||||||
let (s, a) = keyword("use")(s)?;
|
let (s, a) = keyword("use")(s)?;
|
||||||
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
||||||
@ -152,6 +167,7 @@ pub(crate) fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
|
pub(crate) fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
|
||||||
let (s, a) = keyword("use")(s)?;
|
let (s, a) = keyword("use")(s)?;
|
||||||
let (s, b) = list(symbol(","), named_parameter_assignment)(s)?;
|
let (s, b) = list(symbol(","), named_parameter_assignment)(s)?;
|
||||||
@ -163,6 +179,7 @@ pub(crate) fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
|
pub(crate) fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
|
||||||
let (s, a) = keyword("use")(s)?;
|
let (s, a) = keyword("use")(s)?;
|
||||||
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?;
|
||||||
@ -178,6 +195,7 @@ pub(crate) fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn config(s: Span) -> IResult<Span, Config> {
|
pub(crate) fn config(s: Span) -> IResult<Span, Config> {
|
||||||
let (s, a) = keyword("config")(s)?;
|
let (s, a) = keyword("config")(s)?;
|
||||||
Ok((s, Config { nodes: (a,) }))
|
Ok((s, Config { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
|
pub(crate) fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
|
||||||
let (s, a) = opt(r#static)(s)?;
|
let (s, a) = opt(r#static)(s)?;
|
||||||
let (s, b) = keyword("constraint")(s)?;
|
let (s, b) = keyword("constraint")(s)?;
|
||||||
@ -17,18 +18,21 @@ pub(crate) fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclara
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn r#static(s: Span) -> IResult<Span, Static> {
|
pub(crate) fn r#static(s: Span) -> IResult<Span, Static> {
|
||||||
let (s, a) = keyword("static")(s)?;
|
let (s, a) = keyword("static")(s)?;
|
||||||
Ok((s, Static { nodes: (a,) }))
|
Ok((s, Static { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_block(s: Span) -> IResult<Span, ConstraintBlock> {
|
pub(crate) fn constraint_block(s: Span) -> IResult<Span, ConstraintBlock> {
|
||||||
let (s, a) = brace(many0(constraint_block_item))(s)?;
|
let (s, a) = brace(many0(constraint_block_item))(s)?;
|
||||||
Ok((s, ConstraintBlock { nodes: (a,) }))
|
Ok((s, ConstraintBlock { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockItem> {
|
pub(crate) fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockItem> {
|
||||||
alt((
|
alt((
|
||||||
constraint_block_item_solve,
|
constraint_block_item_solve,
|
||||||
@ -39,6 +43,7 @@ pub(crate) fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBlockItem> {
|
pub(crate) fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBlockItem> {
|
||||||
let (s, a) = keyword("solve")(s)?;
|
let (s, a) = keyword("solve")(s)?;
|
||||||
let (s, b) = solve_before_list(s)?;
|
let (s, b) = solve_before_list(s)?;
|
||||||
@ -54,12 +59,14 @@ pub(crate) fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn solve_before_list(s: Span) -> IResult<Span, SolveBeforeList> {
|
pub(crate) fn solve_before_list(s: Span) -> IResult<Span, SolveBeforeList> {
|
||||||
let (s, a) = list(symbol(","), constraint_primary)(s)?;
|
let (s, a) = list(symbol(","), constraint_primary)(s)?;
|
||||||
Ok((s, SolveBeforeList { nodes: (a,) }))
|
Ok((s, SolveBeforeList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
|
pub(crate) fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
|
||||||
let (s, a) = opt(implicit_class_handle_or_class_scope)(s)?;
|
let (s, a) = opt(implicit_class_handle_or_class_scope)(s)?;
|
||||||
let (s, b) = hierarchical_identifier(s)?;
|
let (s, b) = hierarchical_identifier(s)?;
|
||||||
@ -68,6 +75,7 @@ pub(crate) fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
alt((
|
alt((
|
||||||
constraint_expression_expression,
|
constraint_expression_expression,
|
||||||
@ -83,6 +91,7 @@ pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpressi
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
let (s, a) = opt(soft)(s)?;
|
let (s, a) = opt(soft)(s)?;
|
||||||
let (s, b) = expression_or_dist(s)?;
|
let (s, b) = expression_or_dist(s)?;
|
||||||
@ -96,6 +105,7 @@ pub(crate) fn constraint_expression_expression(s: Span) -> IResult<Span, Constra
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn soft(s: Span) -> IResult<Span, Soft> {
|
pub(crate) fn soft(s: Span) -> IResult<Span, Soft> {
|
||||||
let (s, a) = keyword("soft")(s)?;
|
let (s, a) = keyword("soft")(s)?;
|
||||||
Ok((s, Soft { nodes: (a,) }))
|
Ok((s, Soft { nodes: (a,) }))
|
||||||
@ -103,6 +113,7 @@ pub(crate) fn soft(s: Span) -> IResult<Span, Soft> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
let (s, b) = symbol("->")(s)?;
|
let (s, b) = symbol("->")(s)?;
|
||||||
@ -114,6 +125,7 @@ pub(crate) fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintEx
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
let (s, a) = keyword("if")(s)?;
|
let (s, a) = keyword("if")(s)?;
|
||||||
let (s, b) = paren(expression)(s)?;
|
let (s, b) = paren(expression)(s)?;
|
||||||
@ -128,6 +140,7 @@ pub(crate) fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpre
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
let (s, a) = keyword("foreach")(s)?;
|
let (s, a) = keyword("foreach")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -142,6 +155,7 @@ pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, Constraint
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpression> {
|
pub(crate) fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpression> {
|
||||||
let (s, a) = keyword("disable")(s)?;
|
let (s, a) = keyword("disable")(s)?;
|
||||||
let (s, b) = keyword("soft")(s)?;
|
let (s, b) = keyword("soft")(s)?;
|
||||||
@ -156,6 +170,7 @@ pub(crate) fn constraint_expression_disable(s: Span) -> IResult<Span, Constraint
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn uniqueness_constraint(s: Span) -> IResult<Span, UniquenessConstraint> {
|
pub(crate) fn uniqueness_constraint(s: Span) -> IResult<Span, UniquenessConstraint> {
|
||||||
let (s, a) = keyword("unique")(s)?;
|
let (s, a) = keyword("unique")(s)?;
|
||||||
let (s, b) = brace(open_range_list)(s)?;
|
let (s, b) = brace(open_range_list)(s)?;
|
||||||
@ -163,6 +178,7 @@ pub(crate) fn uniqueness_constraint(s: Span) -> IResult<Span, UniquenessConstrai
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
|
pub(crate) fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
|
||||||
alt((
|
alt((
|
||||||
map(constraint_expression, |x| {
|
map(constraint_expression, |x| {
|
||||||
@ -173,6 +189,7 @@ pub(crate) fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
|
pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
|
||||||
let (s, a) = brace(many0(constraint_expression))(s)?;
|
let (s, a) = brace(many0(constraint_expression))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -183,6 +200,7 @@ pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dist_list(s: Span) -> IResult<Span, DistList> {
|
pub(crate) fn dist_list(s: Span) -> IResult<Span, DistList> {
|
||||||
let (s, a) = list(symbol(","), dist_item)(s)?;
|
let (s, a) = list(symbol(","), dist_item)(s)?;
|
||||||
Ok((s, DistList { nodes: (a,) }))
|
Ok((s, DistList { nodes: (a,) }))
|
||||||
@ -190,6 +208,7 @@ pub(crate) fn dist_list(s: Span) -> IResult<Span, DistList> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dist_item(s: Span) -> IResult<Span, DistItem> {
|
pub(crate) fn dist_item(s: Span) -> IResult<Span, DistItem> {
|
||||||
let (s, a) = value_range(s)?;
|
let (s, a) = value_range(s)?;
|
||||||
let (s, b) = opt(dist_weight)(s)?;
|
let (s, b) = opt(dist_weight)(s)?;
|
||||||
@ -197,11 +216,13 @@ pub(crate) fn dist_item(s: Span) -> IResult<Span, DistItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dist_weight(s: Span) -> IResult<Span, DistWeight> {
|
pub(crate) fn dist_weight(s: Span) -> IResult<Span, DistWeight> {
|
||||||
alt((dist_weight_equal, dist_weight_divide))(s)
|
alt((dist_weight_equal, dist_weight_divide))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
|
pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
|
||||||
let (s, a) = symbol(":=")(s)?;
|
let (s, a) = symbol(":=")(s)?;
|
||||||
let (s, b) = expression(s)?;
|
let (s, b) = expression(s)?;
|
||||||
@ -212,6 +233,7 @@ pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
|
pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
|
||||||
let (s, a) = symbol(":/")(s)?;
|
let (s, a) = symbol(":/")(s)?;
|
||||||
let (s, b) = expression(s)?;
|
let (s, b) = expression(s)?;
|
||||||
@ -222,6 +244,7 @@ pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype> {
|
pub(crate) fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype> {
|
||||||
let (s, a) = opt(constraint_prototype_qualifier)(s)?;
|
let (s, a) = opt(constraint_prototype_qualifier)(s)?;
|
||||||
let (s, b) = opt(r#static)(s)?;
|
let (s, b) = opt(r#static)(s)?;
|
||||||
@ -237,6 +260,7 @@ pub(crate) fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn constraint_prototype_qualifier(
|
pub(crate) fn constraint_prototype_qualifier(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ConstraintPrototypeQualifier> {
|
) -> IResult<Span, ConstraintPrototypeQualifier> {
|
||||||
@ -251,6 +275,7 @@ pub(crate) fn constraint_prototype_qualifier(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintDeclaration> {
|
pub(crate) fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintDeclaration> {
|
||||||
let (s, a) = opt(r#static)(s)?;
|
let (s, a) = opt(r#static)(s)?;
|
||||||
let (s, b) = keyword("constraint")(s)?;
|
let (s, b) = keyword("constraint")(s)?;
|
||||||
@ -266,6 +291,7 @@ pub(crate) fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternCons
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn identifier_list(s: Span) -> IResult<Span, IdentifierList> {
|
pub(crate) fn identifier_list(s: Span) -> IResult<Span, IdentifierList> {
|
||||||
let (s, a) = list(symbol(","), identifier)(s)?;
|
let (s, a) = list(symbol(","), identifier)(s)?;
|
||||||
Ok((s, IdentifierList { nodes: (a,) }))
|
Ok((s, IdentifierList { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
interface_or_generate_item_module,
|
interface_or_generate_item_module,
|
||||||
@ -12,6 +13,7 @@ pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGe
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_or_generate_item_module(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
pub(crate) fn interface_or_generate_item_module(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_common_item(s)?;
|
let (s, b) = module_common_item(s)?;
|
||||||
@ -22,6 +24,7 @@ pub(crate) fn interface_or_generate_item_module(s: Span) -> IResult<Span, Interf
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_or_generate_item_extern(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
pub(crate) fn interface_or_generate_item_extern(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = extern_tf_declaration(s)?;
|
let (s, b) = extern_tf_declaration(s)?;
|
||||||
@ -32,11 +35,13 @@ pub(crate) fn interface_or_generate_item_extern(s: Span) -> IResult<Span, Interf
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn extern_tf_declaration(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
pub(crate) fn extern_tf_declaration(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
||||||
alt((extern_tf_declaration_method, extern_tf_declaration_task))(s)
|
alt((extern_tf_declaration_method, extern_tf_declaration_task))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = method_prototype(s)?;
|
let (s, b) = method_prototype(s)?;
|
||||||
@ -48,6 +53,7 @@ pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = keyword("forkjoin")(s)?;
|
let (s, b) = keyword("forkjoin")(s)?;
|
||||||
@ -62,6 +68,7 @@ pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDecla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
|
pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(port_declaration, symbol(";")), |x| {
|
map(pair(port_declaration, symbol(";")), |x| {
|
||||||
@ -74,6 +81,7 @@ pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_interface_item(s: Span) -> IResult<Span, NonPortInterfaceItem> {
|
pub(crate) fn non_port_interface_item(s: Span) -> IResult<Span, NonPortInterfaceItem> {
|
||||||
alt((
|
alt((
|
||||||
map(generate_region, |x| {
|
map(generate_region, |x| {
|
||||||
|
@ -3,12 +3,14 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn library_text(s: Span) -> IResult<Span, LibraryText> {
|
pub(crate) fn library_text(s: Span) -> IResult<Span, LibraryText> {
|
||||||
let (s, a) = many0(library_description)(s)?;
|
let (s, a) = many0(library_description)(s)?;
|
||||||
Ok((s, LibraryText { nodes: (a,) }))
|
Ok((s, LibraryText { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
|
pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
|
||||||
alt((
|
alt((
|
||||||
map(library_declaration, |x| {
|
map(library_declaration, |x| {
|
||||||
@ -25,6 +27,7 @@ pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
|
pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
|
||||||
let (s, a) = keyword("library")(s)?;
|
let (s, a) = keyword("library")(s)?;
|
||||||
let (s, b) = library_identifier(s)?;
|
let (s, b) = library_identifier(s)?;
|
||||||
@ -40,6 +43,7 @@ pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
|
pub(crate) fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
|
||||||
let (s, a) = keyword("include")(s)?;
|
let (s, a) = keyword("include")(s)?;
|
||||||
let (s, b) = file_path_spec(s)?;
|
let (s, b) = file_path_spec(s)?;
|
||||||
@ -48,6 +52,7 @@ pub(crate) fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
|
pub(crate) fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
|
||||||
alt((
|
alt((
|
||||||
map(string_literal, |x| FilePathSpec::Literal(x)),
|
map(string_literal, |x| FilePathSpec::Literal(x)),
|
||||||
@ -56,6 +61,7 @@ pub(crate) fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn file_path_spec_non_literal(s: Span) -> IResult<Span, FilePathSpec> {
|
pub(crate) fn file_path_spec_non_literal(s: Span) -> IResult<Span, FilePathSpec> {
|
||||||
let (s, a) = ws(map(is_not(",; "), |x| into_locate(x)))(s)?;
|
let (s, a) = ws(map(is_not(",; "), |x| into_locate(x)))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
||||||
alt((
|
alt((
|
||||||
elaboration_system_task_fatal,
|
elaboration_system_task_fatal,
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSyste
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
||||||
let (s, a) = keyword("$fatal")(s)?;
|
let (s, a) = keyword("$fatal")(s)?;
|
||||||
let (s, b) = opt(paren(pair(
|
let (s, b) = opt(paren(pair(
|
||||||
@ -27,6 +29,7 @@ pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult<Span, Elaboratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
pub(crate) fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
||||||
let (s, a) = keyword("$error")(s)?;
|
let (s, a) = keyword("$error")(s)?;
|
||||||
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
||||||
@ -38,6 +41,7 @@ pub(crate) fn elaboration_system_task_error(s: Span) -> IResult<Span, Elaboratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
pub(crate) fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
||||||
let (s, a) = keyword("$warning")(s)?;
|
let (s, a) = keyword("$warning")(s)?;
|
||||||
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
||||||
@ -51,6 +55,7 @@ pub(crate) fn elaboration_system_task_warning(s: Span) -> IResult<Span, Elaborat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
pub(crate) fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemTask> {
|
||||||
let (s, a) = keyword("$info")(s)?;
|
let (s, a) = keyword("$info")(s)?;
|
||||||
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
let (s, b) = opt(paren(opt(list_of_arguments)))(s)?;
|
||||||
@ -62,6 +67,7 @@ pub(crate) fn elaboration_system_task_info(s: Span) -> IResult<Span, Elaboration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
|
pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("0"), |x| FinishNumber::Zero(Box::new(x))),
|
map(symbol("0"), |x| FinishNumber::Zero(Box::new(x))),
|
||||||
@ -71,6 +77,7 @@ pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
|
pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
|
||||||
alt((
|
alt((
|
||||||
map(module_or_generate_item_declaration, |x| {
|
map(module_or_generate_item_declaration, |x| {
|
||||||
@ -114,6 +121,7 @@ pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
|
pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(port_declaration, symbol(";")), |x| {
|
map(pair(port_declaration, symbol(";")), |x| {
|
||||||
@ -126,6 +134,7 @@ pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
module_or_generate_item_parameter,
|
module_or_generate_item_parameter,
|
||||||
@ -137,6 +146,7 @@ pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerate
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_parameter(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item_parameter(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = parameter_override(s)?;
|
let (s, b) = parameter_override(s)?;
|
||||||
@ -147,6 +157,7 @@ pub(crate) fn module_or_generate_item_parameter(s: Span) -> IResult<Span, Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = gate_instantiation(s)?;
|
let (s, b) = gate_instantiation(s)?;
|
||||||
@ -157,6 +168,7 @@ pub(crate) fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGen
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = udp_instantiation(s)?;
|
let (s, b) = udp_instantiation(s)?;
|
||||||
@ -167,6 +179,7 @@ pub(crate) fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGene
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_instantiation(s)?;
|
let (s, b) = module_instantiation(s)?;
|
||||||
@ -178,6 +191,7 @@ pub(crate) fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrG
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_module_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
pub(crate) fn module_or_generate_item_module_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_common_item(s)?;
|
let (s, b) = module_common_item(s)?;
|
||||||
@ -190,6 +204,7 @@ pub(crate) fn module_or_generate_item_module_item(s: Span) -> IResult<Span, Modu
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_declaration(
|
pub(crate) fn module_or_generate_item_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
||||||
@ -209,6 +224,7 @@ pub(crate) fn module_or_generate_item_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_declaration_clocking(
|
pub(crate) fn module_or_generate_item_declaration_clocking(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
||||||
@ -227,6 +243,7 @@ pub(crate) fn module_or_generate_item_declaration_clocking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_or_generate_item_declaration_disable(
|
pub(crate) fn module_or_generate_item_declaration_disable(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
|
||||||
@ -246,6 +263,7 @@ pub(crate) fn module_or_generate_item_declaration_disable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem> {
|
pub(crate) fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem> {
|
||||||
alt((
|
alt((
|
||||||
map(generate_region, |x| {
|
map(generate_region, |x| {
|
||||||
@ -274,6 +292,7 @@ pub(crate) fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortModuleItem> {
|
pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortModuleItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = specparam_declaration(s)?;
|
let (s, b) = specparam_declaration(s)?;
|
||||||
@ -284,6 +303,7 @@ pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
|
pub(crate) fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
|
||||||
let (s, a) = keyword("defparam")(s)?;
|
let (s, a) = keyword("defparam")(s)?;
|
||||||
let (s, b) = list_of_defparam_assignments(s)?;
|
let (s, b) = list_of_defparam_assignments(s)?;
|
||||||
@ -292,11 +312,13 @@ pub(crate) fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_directive(s: Span) -> IResult<Span, BindDirective> {
|
pub(crate) fn bind_directive(s: Span) -> IResult<Span, BindDirective> {
|
||||||
alt((bind_directive_scope, bind_directive_instance))(s)
|
alt((bind_directive_scope, bind_directive_instance))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
|
pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
|
||||||
let (s, a) = keyword("bind")(s)?;
|
let (s, a) = keyword("bind")(s)?;
|
||||||
let (s, b) = bind_target_scope(s)?;
|
let (s, b) = bind_target_scope(s)?;
|
||||||
@ -312,6 +334,7 @@ pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
|
pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
|
||||||
let (s, a) = keyword("bind")(s)?;
|
let (s, a) = keyword("bind")(s)?;
|
||||||
let (s, b) = bind_target_instance(s)?;
|
let (s, b) = bind_target_instance(s)?;
|
||||||
@ -326,6 +349,7 @@ pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
|
pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
|
||||||
alt((
|
alt((
|
||||||
map(module_identifier, |x| {
|
map(module_identifier, |x| {
|
||||||
@ -338,6 +362,7 @@ pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_target_instance(s: Span) -> IResult<Span, BindTargetInstance> {
|
pub(crate) fn bind_target_instance(s: Span) -> IResult<Span, BindTargetInstance> {
|
||||||
let (s, a) = hierarchical_identifier(s)?;
|
let (s, a) = hierarchical_identifier(s)?;
|
||||||
let (s, b) = constant_bit_select(s)?;
|
let (s, b) = constant_bit_select(s)?;
|
||||||
@ -345,12 +370,14 @@ pub(crate) fn bind_target_instance(s: Span) -> IResult<Span, BindTargetInstance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_target_instance_list(s: Span) -> IResult<Span, BindTargetInstanceList> {
|
pub(crate) fn bind_target_instance_list(s: Span) -> IResult<Span, BindTargetInstanceList> {
|
||||||
let (s, a) = list(symbol(","), bind_target_instance)(s)?;
|
let (s, a) = list(symbol(","), bind_target_instance)(s)?;
|
||||||
Ok((s, BindTargetInstanceList { nodes: (a,) }))
|
Ok((s, BindTargetInstanceList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn bind_instantiation(s: Span) -> IResult<Span, BindInstantiation> {
|
pub(crate) fn bind_instantiation(s: Span) -> IResult<Span, BindInstantiation> {
|
||||||
alt((
|
alt((
|
||||||
map(program_instantiation, |x| {
|
map(program_instantiation, |x| {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
|
pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
|
||||||
alt((
|
alt((
|
||||||
parameter_port_list_assignment,
|
parameter_port_list_assignment,
|
||||||
@ -12,6 +13,7 @@ pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortList> {
|
pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortList> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(pair(
|
let (s, b) = paren(pair(
|
||||||
@ -25,6 +27,7 @@ pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, Parameter
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_list_declaration(s: Span) -> IResult<Span, ParameterPortList> {
|
pub(crate) fn parameter_port_list_declaration(s: Span) -> IResult<Span, ParameterPortList> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = paren(list(symbol(","), parameter_port_declaration))(s)?;
|
let (s, b) = paren(list(symbol(","), parameter_port_declaration))(s)?;
|
||||||
@ -35,6 +38,7 @@ pub(crate) fn parameter_port_list_declaration(s: Span) -> IResult<Span, Paramete
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
|
pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
|
||||||
let (s, a) = symbol("#")(s)?;
|
let (s, a) = symbol("#")(s)?;
|
||||||
let (s, b) = symbol("(")(s)?;
|
let (s, b) = symbol("(")(s)?;
|
||||||
@ -43,6 +47,7 @@ pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortL
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclaration> {
|
pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
map(parameter_declaration, |x| {
|
map(parameter_declaration, |x| {
|
||||||
@ -57,6 +62,7 @@ pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPort
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_declaration_param_list(
|
pub(crate) fn parameter_port_declaration_param_list(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ParameterPortDeclaration> {
|
) -> IResult<Span, ParameterPortDeclaration> {
|
||||||
@ -71,6 +77,7 @@ pub(crate) fn parameter_port_declaration_param_list(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parameter_port_declaration_type_list(
|
pub(crate) fn parameter_port_declaration_type_list(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ParameterPortDeclaration> {
|
) -> IResult<Span, ParameterPortDeclaration> {
|
||||||
@ -85,12 +92,14 @@ pub(crate) fn parameter_port_declaration_type_list(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_ports(s: Span) -> IResult<Span, ListOfPorts> {
|
pub(crate) fn list_of_ports(s: Span) -> IResult<Span, ListOfPorts> {
|
||||||
let (s, a) = paren(list(symbol(","), port))(s)?;
|
let (s, a) = paren(list(symbol(","), port))(s)?;
|
||||||
Ok((s, ListOfPorts { nodes: (a,) }))
|
Ok((s, ListOfPorts { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDeclarations> {
|
pub(crate) fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDeclarations> {
|
||||||
let (s, a) = paren(opt(list(
|
let (s, a) = paren(opt(list(
|
||||||
symbol(","),
|
symbol(","),
|
||||||
@ -100,6 +109,7 @@ pub(crate) fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
port_declaration_inout,
|
port_declaration_inout,
|
||||||
@ -111,6 +121,7 @@ pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = inout_declaration(s)?;
|
let (s, b) = inout_declaration(s)?;
|
||||||
@ -121,6 +132,7 @@ pub(crate) fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = input_declaration(s)?;
|
let (s, b) = input_declaration(s)?;
|
||||||
@ -131,6 +143,7 @@ pub(crate) fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = output_declaration(s)?;
|
let (s, b) = output_declaration(s)?;
|
||||||
@ -141,6 +154,7 @@ pub(crate) fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = ref_declaration(s)?;
|
let (s, b) = ref_declaration(s)?;
|
||||||
@ -151,6 +165,7 @@ pub(crate) fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclaration> {
|
pub(crate) fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = interface_port_declaration(s)?;
|
let (s, b) = interface_port_declaration(s)?;
|
||||||
@ -161,18 +176,21 @@ pub(crate) fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port(s: Span) -> IResult<Span, Port> {
|
pub(crate) fn port(s: Span) -> IResult<Span, Port> {
|
||||||
alt((port_non_named, port_named))(s)
|
alt((port_non_named, port_named))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_non_named(s: Span) -> IResult<Span, Port> {
|
pub(crate) fn port_non_named(s: Span) -> IResult<Span, Port> {
|
||||||
let (s, a) = opt(port_expression)(s)?;
|
let (s, a) = opt(port_expression)(s)?;
|
||||||
Ok((s, Port::NonNamed(Box::new(PortNonNamed { nodes: (a,) }))))
|
Ok((s, Port::NonNamed(Box::new(PortNonNamed { nodes: (a,) }))))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_named(s: Span) -> IResult<Span, Port> {
|
pub(crate) fn port_named(s: Span) -> IResult<Span, Port> {
|
||||||
let (s, a) = symbol(".")(s)?;
|
let (s, a) = symbol(".")(s)?;
|
||||||
let (s, b) = port_identifier(s)?;
|
let (s, b) = port_identifier(s)?;
|
||||||
@ -181,6 +199,7 @@ pub(crate) fn port_named(s: Span) -> IResult<Span, Port> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
|
pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
|
||||||
alt((
|
alt((
|
||||||
map(port_reference, |x| {
|
map(port_reference, |x| {
|
||||||
@ -191,6 +210,7 @@ pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
|
pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
|
||||||
let (s, a) = brace(list(symbol(","), port_reference))(s)?;
|
let (s, a) = brace(list(symbol(","), port_reference))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -200,6 +220,7 @@ pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_reference(s: Span) -> IResult<Span, PortReference> {
|
pub(crate) fn port_reference(s: Span) -> IResult<Span, PortReference> {
|
||||||
let (s, a) = port_identifier(s)?;
|
let (s, a) = port_identifier(s)?;
|
||||||
let (s, b) = constant_select(s)?;
|
let (s, b) = constant_select(s)?;
|
||||||
@ -207,6 +228,7 @@ pub(crate) fn port_reference(s: Span) -> IResult<Span, PortReference> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn port_direction(s: Span) -> IResult<Span, PortDirection> {
|
pub(crate) fn port_direction(s: Span) -> IResult<Span, PortDirection> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("input"), |x| PortDirection::Input(Box::new(x))),
|
map(keyword("input"), |x| PortDirection::Input(Box::new(x))),
|
||||||
@ -217,6 +239,7 @@ pub(crate) fn port_direction(s: Span) -> IResult<Span, PortDirection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_port_header(s: Span) -> IResult<Span, NetPortHeader> {
|
pub(crate) fn net_port_header(s: Span) -> IResult<Span, NetPortHeader> {
|
||||||
let (s, a) = opt(port_direction)(s)?;
|
let (s, a) = opt(port_direction)(s)?;
|
||||||
let (s, b) = net_port_type(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
@ -224,6 +247,7 @@ pub(crate) fn net_port_header(s: Span) -> IResult<Span, NetPortHeader> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn variable_port_header(s: Span) -> IResult<Span, VariablePortHeader> {
|
pub(crate) fn variable_port_header(s: Span) -> IResult<Span, VariablePortHeader> {
|
||||||
let (s, a) = opt(port_direction)(s)?;
|
let (s, a) = opt(port_direction)(s)?;
|
||||||
let (s, b) = variable_port_type(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
@ -231,6 +255,7 @@ pub(crate) fn variable_port_header(s: Span) -> IResult<Span, VariablePortHeader>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeader> {
|
pub(crate) fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeader> {
|
||||||
alt((
|
alt((
|
||||||
interface_port_header_identifier,
|
interface_port_header_identifier,
|
||||||
@ -239,6 +264,7 @@ pub(crate) fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeade
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_port_header_identifier(s: Span) -> IResult<Span, InterfacePortHeader> {
|
pub(crate) fn interface_port_header_identifier(s: Span) -> IResult<Span, InterfacePortHeader> {
|
||||||
let (s, a) = interface_identifier(s)?;
|
let (s, a) = interface_identifier(s)?;
|
||||||
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
||||||
@ -249,6 +275,7 @@ pub(crate) fn interface_port_header_identifier(s: Span) -> IResult<Span, Interfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_port_header_interface(s: Span) -> IResult<Span, InterfacePortHeader> {
|
pub(crate) fn interface_port_header_interface(s: Span) -> IResult<Span, InterfacePortHeader> {
|
||||||
let (s, a) = keyword("interface")(s)?;
|
let (s, a) = keyword("interface")(s)?;
|
||||||
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?;
|
||||||
@ -259,6 +286,7 @@ pub(crate) fn interface_port_header_interface(s: Span) -> IResult<Span, Interfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
ansi_port_declaration_net,
|
ansi_port_declaration_net,
|
||||||
@ -268,6 +296,7 @@ pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
pub(crate) fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
||||||
let (s, a) = opt(net_port_header_or_interface_port_header)(s)?;
|
let (s, a) = opt(net_port_header_or_interface_port_header)(s)?;
|
||||||
let (s, b) = port_identifier(s)?;
|
let (s, b) = port_identifier(s)?;
|
||||||
@ -282,6 +311,7 @@ pub(crate) fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn net_port_header_or_interface_port_header(
|
pub(crate) fn net_port_header_or_interface_port_header(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, NetPortHeaderOrInterfacePortHeader> {
|
) -> IResult<Span, NetPortHeaderOrInterfacePortHeader> {
|
||||||
@ -296,6 +326,7 @@ pub(crate) fn net_port_header_or_interface_port_header(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ansi_port_declaration_port(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
pub(crate) fn ansi_port_declaration_port(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
||||||
let (s, a) = opt(variable_port_header)(s)?;
|
let (s, a) = opt(variable_port_header)(s)?;
|
||||||
let (s, b) = port_identifier(s)?;
|
let (s, b) = port_identifier(s)?;
|
||||||
@ -310,6 +341,7 @@ pub(crate) fn ansi_port_declaration_port(s: Span) -> IResult<Span, AnsiPortDecla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn ansi_port_declaration_paren(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
pub(crate) fn ansi_port_declaration_paren(s: Span) -> IResult<Span, AnsiPortDeclaration> {
|
||||||
let (s, a) = opt(port_direction)(s)?;
|
let (s, a) = opt(port_direction)(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
|
pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
|
||||||
alt((
|
alt((
|
||||||
map(package_or_generate_item_declaration, |x| {
|
map(package_or_generate_item_declaration, |x| {
|
||||||
@ -21,6 +22,7 @@ pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_or_generate_item_declaration(
|
pub(crate) fn package_or_generate_item_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, PackageOrGenerateItemDeclaration> {
|
) -> IResult<Span, PackageOrGenerateItemDeclaration> {
|
||||||
@ -74,6 +76,7 @@ pub(crate) fn package_or_generate_item_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
|
pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
|
||||||
let (s, a) = keyword("program")(s)?;
|
let (s, a) = keyword("program")(s)?;
|
||||||
let (s, b) = symbol(";")(s)?;
|
let (s, b) = symbol(";")(s)?;
|
||||||
@ -88,6 +91,7 @@ pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn anonymous_program_item(s: Span) -> IResult<Span, AnonymousProgramItem> {
|
pub(crate) fn anonymous_program_item(s: Span) -> IResult<Span, AnonymousProgramItem> {
|
||||||
alt((
|
alt((
|
||||||
map(task_declaration, |x| {
|
map(task_declaration, |x| {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
|
pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(port_declaration, symbol(";")), |x| {
|
map(pair(port_declaration, symbol(";")), |x| {
|
||||||
@ -15,6 +16,7 @@ pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
alt((
|
alt((
|
||||||
non_port_program_item_assign,
|
non_port_program_item_assign,
|
||||||
@ -32,6 +34,7 @@ pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = continuous_assign(s)?;
|
let (s, b) = continuous_assign(s)?;
|
||||||
@ -43,6 +46,7 @@ pub(crate) fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProg
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_or_generate_item_declaration(s)?;
|
let (s, b) = module_or_generate_item_declaration(s)?;
|
||||||
@ -53,6 +57,7 @@ pub(crate) fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProg
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = initial_construct(s)?;
|
let (s, b) = initial_construct(s)?;
|
||||||
@ -63,6 +68,7 @@ pub(crate) fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortPro
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = final_construct(s)?;
|
let (s, b) = final_construct(s)?;
|
||||||
@ -73,6 +79,7 @@ pub(crate) fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortProgramItem> {
|
pub(crate) fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortProgramItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = concurrent_assertion_item(s)?;
|
let (s, b) = concurrent_assertion_item(s)?;
|
||||||
@ -83,6 +90,7 @@ pub(crate) fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_generate_item(s: Span) -> IResult<Span, ProgramGenerateItem> {
|
pub(crate) fn program_generate_item(s: Span) -> IResult<Span, ProgramGenerateItem> {
|
||||||
alt((
|
alt((
|
||||||
map(loop_generate_construct, |x| {
|
map(loop_generate_construct, |x| {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn source_text(s: Span) -> IResult<Span, SourceText> {
|
pub(crate) fn source_text(s: Span) -> IResult<Span, SourceText> {
|
||||||
let (s, a) = opt(timeunits_declaration)(s)?;
|
let (s, a) = opt(timeunits_declaration)(s)?;
|
||||||
let (s, b) = many0(description)(s)?;
|
let (s, b) = many0(description)(s)?;
|
||||||
@ -10,6 +11,7 @@ pub(crate) fn source_text(s: Span) -> IResult<Span, SourceText> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn description(s: Span) -> IResult<Span, Description> {
|
pub(crate) fn description(s: Span) -> IResult<Span, Description> {
|
||||||
alt((
|
alt((
|
||||||
map(module_declaration, |x| {
|
map(module_declaration, |x| {
|
||||||
@ -40,6 +42,7 @@ pub(crate) fn description(s: Span) -> IResult<Span, Description> {
|
|||||||
|
|
||||||
#[recursive_parser]
|
#[recursive_parser]
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn description_package_item(s: Span) -> IResult<Span, Description> {
|
pub(crate) fn description_package_item(s: Span) -> IResult<Span, Description> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = package_item(s)?;
|
let (s, b) = package_item(s)?;
|
||||||
@ -50,6 +53,7 @@ pub(crate) fn description_package_item(s: Span) -> IResult<Span, Description> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn description_bind_directive(s: Span) -> IResult<Span, Description> {
|
pub(crate) fn description_bind_directive(s: Span) -> IResult<Span, Description> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = bind_directive(s)?;
|
let (s, b) = bind_directive(s)?;
|
||||||
@ -60,6 +64,7 @@ pub(crate) fn description_bind_directive(s: Span) -> IResult<Span, Description>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
|
pub(crate) fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_keyword(s)?;
|
let (s, b) = module_keyword(s)?;
|
||||||
@ -78,6 +83,7 @@ pub(crate) fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeade
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
|
pub(crate) fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_keyword(s)?;
|
let (s, b) = module_keyword(s)?;
|
||||||
@ -96,6 +102,7 @@ pub(crate) fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
module_declaration_nonansi,
|
module_declaration_nonansi,
|
||||||
@ -107,6 +114,7 @@ pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
let (s, a) = module_nonansi_header(s)?;
|
let (s, a) = module_nonansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -122,6 +130,7 @@ pub(crate) fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclara
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
let (s, a) = module_ansi_header(s)?;
|
let (s, a) = module_ansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -137,6 +146,7 @@ pub(crate) fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = module_keyword(s)?;
|
let (s, b) = module_keyword(s)?;
|
||||||
@ -157,6 +167,7 @@ pub(crate) fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = module_nonansi_header(s)?;
|
let (s, b) = module_nonansi_header(s)?;
|
||||||
@ -169,6 +180,7 @@ pub(crate) fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
pub(crate) fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = module_ansi_header(s)?;
|
let (s, b) = module_ansi_header(s)?;
|
||||||
@ -179,6 +191,7 @@ pub(crate) fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
|
pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("module"), |x| ModuleKeyword::Module(Box::new(x))),
|
map(keyword("module"), |x| ModuleKeyword::Module(Box::new(x))),
|
||||||
@ -189,6 +202,7 @@ pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
interface_declaration_nonansi,
|
interface_declaration_nonansi,
|
||||||
@ -200,6 +214,7 @@ pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
let (s, a) = interface_nonansi_header(s)?;
|
let (s, a) = interface_nonansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -215,6 +230,7 @@ pub(crate) fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
let (s, a) = interface_ansi_header(s)?;
|
let (s, a) = interface_ansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -230,6 +246,7 @@ pub(crate) fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("interface")(s)?;
|
let (s, b) = keyword("interface")(s)?;
|
||||||
@ -250,6 +267,7 @@ pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult<Span, Interface
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = interface_nonansi_header(s)?;
|
let (s, b) = interface_nonansi_header(s)?;
|
||||||
@ -262,6 +280,7 @@ pub(crate) fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, Int
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
pub(crate) fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = interface_ansi_header(s)?;
|
let (s, b) = interface_ansi_header(s)?;
|
||||||
@ -274,6 +293,7 @@ pub(crate) fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, Interf
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader> {
|
pub(crate) fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("interface")(s)?;
|
let (s, b) = keyword("interface")(s)?;
|
||||||
@ -292,6 +312,7 @@ pub(crate) fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonans
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
|
pub(crate) fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("interface")(s)?;
|
let (s, b) = keyword("interface")(s)?;
|
||||||
@ -310,6 +331,7 @@ pub(crate) fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeade
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
program_declaration_nonansi,
|
program_declaration_nonansi,
|
||||||
@ -321,6 +343,7 @@ pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
let (s, a) = program_nonansi_header(s)?;
|
let (s, a) = program_nonansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -336,6 +359,7 @@ pub(crate) fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDecla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
let (s, a) = program_ansi_header(s)?;
|
let (s, a) = program_ansi_header(s)?;
|
||||||
let (s, b) = opt(timeunits_declaration)(s)?;
|
let (s, b) = opt(timeunits_declaration)(s)?;
|
||||||
@ -351,6 +375,7 @@ pub(crate) fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclarat
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("program")(s)?;
|
let (s, b) = keyword("program")(s)?;
|
||||||
@ -370,6 +395,7 @@ pub(crate) fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = program_nonansi_header(s)?;
|
let (s, b) = program_nonansi_header(s)?;
|
||||||
@ -382,6 +408,7 @@ pub(crate) fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, Progr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
pub(crate) fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = program_ansi_header(s)?;
|
let (s, b) = program_ansi_header(s)?;
|
||||||
@ -392,6 +419,7 @@ pub(crate) fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
|
pub(crate) fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("prgogram")(s)?;
|
let (s, b) = keyword("prgogram")(s)?;
|
||||||
@ -410,6 +438,7 @@ pub(crate) fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHea
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
|
pub(crate) fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("program")(s)?;
|
let (s, b) = keyword("program")(s)?;
|
||||||
@ -428,6 +457,7 @@ pub(crate) fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
|
pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
|
||||||
let (s, a) = keyword("checker")(s)?;
|
let (s, a) = keyword("checker")(s)?;
|
||||||
let (s, b) = checker_identifier(s)?;
|
let (s, b) = checker_identifier(s)?;
|
||||||
@ -445,6 +475,7 @@ pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
|
pub(crate) fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
|
||||||
let (s, a) = opt(map(keyword("virtual"), |x| Virtual { nodes: (x,) }))(s)?;
|
let (s, a) = opt(map(keyword("virtual"), |x| Virtual { nodes: (x,) }))(s)?;
|
||||||
let (s, b) = keyword("class")(s)?;
|
let (s, b) = keyword("class")(s)?;
|
||||||
@ -473,6 +504,7 @@ pub(crate) fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_class_type(s: Span) -> IResult<Span, InterfaceClassType> {
|
pub(crate) fn interface_class_type(s: Span) -> IResult<Span, InterfaceClassType> {
|
||||||
let (s, a) = ps_class_identifier(s)?;
|
let (s, a) = ps_class_identifier(s)?;
|
||||||
let (s, b) = opt(parameter_value_assignment)(s)?;
|
let (s, b) = opt(parameter_value_assignment)(s)?;
|
||||||
@ -480,6 +512,7 @@ pub(crate) fn interface_class_type(s: Span) -> IResult<Span, InterfaceClassType>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceClassDeclaration> {
|
pub(crate) fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceClassDeclaration> {
|
||||||
let (s, a) = keyword("interface")(s)?;
|
let (s, a) = keyword("interface")(s)?;
|
||||||
let (s, b) = keyword("class")(s)?;
|
let (s, b) = keyword("class")(s)?;
|
||||||
@ -502,6 +535,7 @@ pub(crate) fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceCla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
|
pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
|
||||||
alt((
|
alt((
|
||||||
map(type_declaration, |x| {
|
map(type_declaration, |x| {
|
||||||
@ -519,6 +553,7 @@ pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceClassItem> {
|
pub(crate) fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceClassItem> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = interface_class_method(s)?;
|
let (s, b) = interface_class_method(s)?;
|
||||||
@ -529,6 +564,7 @@ pub(crate) fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceCla
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
|
pub(crate) fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
|
||||||
let (s, a) = keyword("pure")(s)?;
|
let (s, a) = keyword("pure")(s)?;
|
||||||
let (s, b) = keyword("virtual")(s)?;
|
let (s, b) = keyword("virtual")(s)?;
|
||||||
@ -543,6 +579,7 @@ pub(crate) fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMet
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
|
pub(crate) fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("package")(s)?;
|
let (s, b) = keyword("package")(s)?;
|
||||||
@ -562,6 +599,7 @@ pub(crate) fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
timeunits_declaration_timeunit_timeprecision,
|
timeunits_declaration_timeunit_timeprecision,
|
||||||
@ -572,6 +610,7 @@ pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
||||||
let (s, a) = keyword("timeunit")(s)?;
|
let (s, a) = keyword("timeunit")(s)?;
|
||||||
let (s, b) = time_literal(s)?;
|
let (s, b) = time_literal(s)?;
|
||||||
@ -586,6 +625,7 @@ pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, Timeunits
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDeclaration> {
|
||||||
let (s, a) = keyword("timeprecision")(s)?;
|
let (s, a) = keyword("timeprecision")(s)?;
|
||||||
let (s, b) = time_literal(s)?;
|
let (s, b) = time_literal(s)?;
|
||||||
@ -599,6 +639,7 @@ pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, Time
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeunits_declaration_timeunit_timeprecision(
|
pub(crate) fn timeunits_declaration_timeunit_timeprecision(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, TimeunitsDeclaration> {
|
) -> IResult<Span, TimeunitsDeclaration> {
|
||||||
@ -619,6 +660,7 @@ pub(crate) fn timeunits_declaration_timeunit_timeprecision(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeunits_declaration_timeprecision_timeunit(
|
pub(crate) fn timeunits_declaration_timeprecision_timeunit(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, TimeunitsDeclaration> {
|
) -> IResult<Span, TimeunitsDeclaration> {
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
|
pub(crate) fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
|
||||||
let (s, a) = keyword("specify")(s)?;
|
let (s, a) = keyword("specify")(s)?;
|
||||||
let (s, b) = many0(specify_item)(s)?;
|
let (s, b) = many0(specify_item)(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
|
pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
|
||||||
alt((
|
alt((
|
||||||
map(specparam_declaration, |x| {
|
map(specparam_declaration, |x| {
|
||||||
@ -32,6 +34,7 @@ pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
|
pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
|
||||||
let (s, a) = alt((
|
let (s, a) = alt((
|
||||||
keyword("pulsestyle_onevent"),
|
keyword("pulsestyle_onevent"),
|
||||||
@ -43,6 +46,7 @@ pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclara
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn showcancelled_declaration(s: Span) -> IResult<Span, ShowcancelledDeclaration> {
|
pub(crate) fn showcancelled_declaration(s: Span) -> IResult<Span, ShowcancelledDeclaration> {
|
||||||
let (s, a) = alt((keyword("showcalcelled"), keyword("noshowcancelled")))(s)?;
|
let (s, a) = alt((keyword("showcalcelled"), keyword("noshowcancelled")))(s)?;
|
||||||
let (s, b) = list_of_path_outputs(s)?;
|
let (s, b) = list_of_path_outputs(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specify_input_terminal_descriptor(
|
pub(crate) fn specify_input_terminal_descriptor(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SpecifyInputTerminalDescriptor> {
|
) -> IResult<Span, SpecifyInputTerminalDescriptor> {
|
||||||
@ -12,6 +13,7 @@ pub(crate) fn specify_input_terminal_descriptor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specify_output_terminal_descriptor(
|
pub(crate) fn specify_output_terminal_descriptor(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, SpecifyOutputTerminalDescriptor> {
|
) -> IResult<Span, SpecifyOutputTerminalDescriptor> {
|
||||||
@ -21,6 +23,7 @@ pub(crate) fn specify_output_terminal_descriptor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
|
pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
|
||||||
alt((
|
alt((
|
||||||
map(input_port_identifier, |x| {
|
map(input_port_identifier, |x| {
|
||||||
@ -34,6 +37,7 @@ pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
|
pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
|
||||||
let (s, a) = interface_identifier(s)?;
|
let (s, a) = interface_identifier(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
@ -45,6 +49,7 @@ pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
|
pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
|
||||||
alt((
|
alt((
|
||||||
map(output_port_identifier, |x| {
|
map(output_port_identifier, |x| {
|
||||||
@ -58,6 +63,7 @@ pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_identifier_interface(s: Span) -> IResult<Span, OutputIdentifier> {
|
pub(crate) fn output_identifier_interface(s: Span) -> IResult<Span, OutputIdentifier> {
|
||||||
let (s, a) = interface_identifier(s)?;
|
let (s, a) = interface_identifier(s)?;
|
||||||
let (s, b) = symbol(".")(s)?;
|
let (s, b) = symbol(".")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
|
pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(simple_path_declaration, symbol(";")), |x| {
|
map(pair(simple_path_declaration, symbol(";")), |x| {
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
simple_path_declaration_parallel,
|
simple_path_declaration_parallel,
|
||||||
@ -26,6 +28,7 @@ pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
||||||
let (s, a) = parallel_path_description(s)?;
|
let (s, a) = parallel_path_description(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -39,6 +42,7 @@ pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimpleP
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
pub(crate) fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclaration> {
|
||||||
let (s, a) = full_path_description(s)?;
|
let (s, a) = full_path_description(s)?;
|
||||||
let (s, b) = symbol("=")(s)?;
|
let (s, b) = symbol("=")(s)?;
|
||||||
@ -50,6 +54,7 @@ pub(crate) fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescription> {
|
pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescription> {
|
||||||
let (s, a) = paren(tuple((
|
let (s, a) = paren(tuple((
|
||||||
specify_input_terminal_descriptor,
|
specify_input_terminal_descriptor,
|
||||||
@ -61,6 +66,7 @@ pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
|
pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
|
||||||
let (s, a) = paren(tuple((
|
let (s, a) = paren(tuple((
|
||||||
list_of_path_inputs,
|
list_of_path_inputs,
|
||||||
@ -72,12 +78,14 @@ pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescriptio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_path_inputs(s: Span) -> IResult<Span, ListOfPathInputs> {
|
pub(crate) fn list_of_path_inputs(s: Span) -> IResult<Span, ListOfPathInputs> {
|
||||||
let (s, a) = list(symbol(","), specify_input_terminal_descriptor)(s)?;
|
let (s, a) = list(symbol(","), specify_input_terminal_descriptor)(s)?;
|
||||||
Ok((s, ListOfPathInputs { nodes: (a,) }))
|
Ok((s, ListOfPathInputs { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_path_outputs(s: Span) -> IResult<Span, ListOfPathOutputs> {
|
pub(crate) fn list_of_path_outputs(s: Span) -> IResult<Span, ListOfPathOutputs> {
|
||||||
let (s, a) = list(symbol(","), specify_output_terminal_descriptor)(s)?;
|
let (s, a) = list(symbol(","), specify_output_terminal_descriptor)(s)?;
|
||||||
Ok((s, ListOfPathOutputs { nodes: (a,) }))
|
Ok((s, ListOfPathOutputs { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
|
pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
|
||||||
alt((
|
alt((
|
||||||
map(list_of_path_delay_expressions, |x| {
|
map(list_of_path_delay_expressions, |x| {
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
|
pub(crate) fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
|
||||||
let (s, a) = paren(list_of_path_delay_expressions)(s)?;
|
let (s, a) = paren(list_of_path_delay_expressions)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -22,24 +24,28 @@ pub(crate) fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn list_of_path_delay_expressions(s: Span) -> IResult<Span, ListOfPathDelayExpressions> {
|
pub(crate) fn list_of_path_delay_expressions(s: Span) -> IResult<Span, ListOfPathDelayExpressions> {
|
||||||
let (s, a) = list(symbol(","), t_path_delay_expression)(s)?;
|
let (s, a) = list(symbol(","), t_path_delay_expression)(s)?;
|
||||||
Ok((s, ListOfPathDelayExpressions { nodes: (a,) }))
|
Ok((s, ListOfPathDelayExpressions { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn t_path_delay_expression(s: Span) -> IResult<Span, TPathDelayExpression> {
|
pub(crate) fn t_path_delay_expression(s: Span) -> IResult<Span, TPathDelayExpression> {
|
||||||
let (s, a) = path_delay_expression(s)?;
|
let (s, a) = path_delay_expression(s)?;
|
||||||
Ok((s, TPathDelayExpression { nodes: (a,) }))
|
Ok((s, TPathDelayExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn path_delay_expression(s: Span) -> IResult<Span, PathDelayExpression> {
|
pub(crate) fn path_delay_expression(s: Span) -> IResult<Span, PathDelayExpression> {
|
||||||
let (s, a) = constant_mintypmax_expression(s)?;
|
let (s, a) = constant_mintypmax_expression(s)?;
|
||||||
Ok((s, PathDelayExpression { nodes: (a,) }))
|
Ok((s, PathDelayExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_sensitive_path_declaration(
|
pub(crate) fn edge_sensitive_path_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
||||||
@ -50,6 +56,7 @@ pub(crate) fn edge_sensitive_path_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_sensitive_path_declaration_parallel(
|
pub(crate) fn edge_sensitive_path_declaration_parallel(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
||||||
@ -65,6 +72,7 @@ pub(crate) fn edge_sensitive_path_declaration_parallel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_sensitive_path_declaration_full(
|
pub(crate) fn edge_sensitive_path_declaration_full(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
) -> IResult<Span, EdgeSensitivePathDeclaration> {
|
||||||
@ -80,6 +88,7 @@ pub(crate) fn edge_sensitive_path_declaration_full(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn parallel_edge_sensitive_path_description(
|
pub(crate) fn parallel_edge_sensitive_path_description(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ParallelEdgeSensitivePathDescription> {
|
) -> IResult<Span, ParallelEdgeSensitivePathDescription> {
|
||||||
@ -99,6 +108,7 @@ pub(crate) fn parallel_edge_sensitive_path_description(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn full_edge_sensitive_path_description(
|
pub(crate) fn full_edge_sensitive_path_description(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, FullEdgeSensitivePathDescription> {
|
) -> IResult<Span, FullEdgeSensitivePathDescription> {
|
||||||
@ -118,12 +128,14 @@ pub(crate) fn full_edge_sensitive_path_description(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_source_expression(s: Span) -> IResult<Span, DataSourceExpression> {
|
pub(crate) fn data_source_expression(s: Span) -> IResult<Span, DataSourceExpression> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, DataSourceExpression { nodes: (a,) }))
|
Ok((s, DataSourceExpression { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
|
pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("posedge"), |x| EdgeIdentifier::Posedge(Box::new(x))),
|
map(keyword("posedge"), |x| EdgeIdentifier::Posedge(Box::new(x))),
|
||||||
@ -133,6 +145,7 @@ pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn state_dependent_path_declaration(
|
pub(crate) fn state_dependent_path_declaration(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, StateDependentPathDeclaration> {
|
) -> IResult<Span, StateDependentPathDeclaration> {
|
||||||
@ -144,6 +157,7 @@ pub(crate) fn state_dependent_path_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn state_dependent_path_declaration_if_simple(
|
pub(crate) fn state_dependent_path_declaration_if_simple(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, StateDependentPathDeclaration> {
|
) -> IResult<Span, StateDependentPathDeclaration> {
|
||||||
@ -159,6 +173,7 @@ pub(crate) fn state_dependent_path_declaration_if_simple(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn state_dependent_path_declaration_if_edge_sensitive(
|
pub(crate) fn state_dependent_path_declaration_if_edge_sensitive(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, StateDependentPathDeclaration> {
|
) -> IResult<Span, StateDependentPathDeclaration> {
|
||||||
@ -174,6 +189,7 @@ pub(crate) fn state_dependent_path_declaration_if_edge_sensitive(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn state_dependent_path_declaration_if_none(
|
pub(crate) fn state_dependent_path_declaration_if_none(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, StateDependentPathDeclaration> {
|
) -> IResult<Span, StateDependentPathDeclaration> {
|
||||||
@ -188,6 +204,7 @@ pub(crate) fn state_dependent_path_declaration_if_none(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn polarity_operator(s: Span) -> IResult<Span, PolarityOperator> {
|
pub(crate) fn polarity_operator(s: Span) -> IResult<Span, PolarityOperator> {
|
||||||
alt((
|
alt((
|
||||||
map(symbol("+"), |x| PolarityOperator { nodes: (x,) }),
|
map(symbol("+"), |x| PolarityOperator { nodes: (x,) }),
|
||||||
|
@ -3,24 +3,28 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timecheck_condition(s: Span) -> IResult<Span, TimecheckCondition> {
|
pub(crate) fn timecheck_condition(s: Span) -> IResult<Span, TimecheckCondition> {
|
||||||
let (s, a) = mintypmax_expression(s)?;
|
let (s, a) = mintypmax_expression(s)?;
|
||||||
Ok((s, TimecheckCondition { nodes: (a,) }))
|
Ok((s, TimecheckCondition { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn controlled_referecne_event(s: Span) -> IResult<Span, ControlledReferenceEvent> {
|
pub(crate) fn controlled_referecne_event(s: Span) -> IResult<Span, ControlledReferenceEvent> {
|
||||||
let (s, a) = controlled_timing_check_event(s)?;
|
let (s, a) = controlled_timing_check_event(s)?;
|
||||||
Ok((s, ControlledReferenceEvent { nodes: (a,) }))
|
Ok((s, ControlledReferenceEvent { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn data_event(s: Span) -> IResult<Span, DataEvent> {
|
pub(crate) fn data_event(s: Span) -> IResult<Span, DataEvent> {
|
||||||
let (s, a) = timing_check_event(s)?;
|
let (s, a) = timing_check_event(s)?;
|
||||||
Ok((s, DataEvent { nodes: (a,) }))
|
Ok((s, DataEvent { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
|
pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
|
||||||
alt((
|
alt((
|
||||||
map(terminal_identifier, |x| {
|
map(terminal_identifier, |x| {
|
||||||
@ -31,6 +35,7 @@ pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData> {
|
pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData> {
|
||||||
let (s, a) = terminal_identifier(s)?;
|
let (s, a) = terminal_identifier(s)?;
|
||||||
let (s, b) = bracket(constant_mintypmax_expression)(s)?;
|
let (s, b) = bracket(constant_mintypmax_expression)(s)?;
|
||||||
@ -41,6 +46,7 @@ pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
|
pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
|
||||||
alt((
|
alt((
|
||||||
map(terminal_identifier, |x| {
|
map(terminal_identifier, |x| {
|
||||||
@ -51,6 +57,7 @@ pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, DelayedReference> {
|
pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, DelayedReference> {
|
||||||
let (s, a) = terminal_identifier(s)?;
|
let (s, a) = terminal_identifier(s)?;
|
||||||
let (s, b) = bracket(constant_mintypmax_expression)(s)?;
|
let (s, b) = bracket(constant_mintypmax_expression)(s)?;
|
||||||
@ -61,54 +68,63 @@ pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, Delayed
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn end_edge_offset(s: Span) -> IResult<Span, EndEdgeOffset> {
|
pub(crate) fn end_edge_offset(s: Span) -> IResult<Span, EndEdgeOffset> {
|
||||||
let (s, a) = mintypmax_expression(s)?;
|
let (s, a) = mintypmax_expression(s)?;
|
||||||
Ok((s, EndEdgeOffset { nodes: (a,) }))
|
Ok((s, EndEdgeOffset { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn event_based_flag(s: Span) -> IResult<Span, EventBasedFlag> {
|
pub(crate) fn event_based_flag(s: Span) -> IResult<Span, EventBasedFlag> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
Ok((s, EventBasedFlag { nodes: (a,) }))
|
Ok((s, EventBasedFlag { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn notifier(s: Span) -> IResult<Span, Notifier> {
|
pub(crate) fn notifier(s: Span) -> IResult<Span, Notifier> {
|
||||||
let (s, a) = variable_identifier(s)?;
|
let (s, a) = variable_identifier(s)?;
|
||||||
Ok((s, Notifier { nodes: (a,) }))
|
Ok((s, Notifier { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn referecne_event(s: Span) -> IResult<Span, ReferenceEvent> {
|
pub(crate) fn referecne_event(s: Span) -> IResult<Span, ReferenceEvent> {
|
||||||
let (s, a) = timing_check_event(s)?;
|
let (s, a) = timing_check_event(s)?;
|
||||||
Ok((s, ReferenceEvent { nodes: (a,) }))
|
Ok((s, ReferenceEvent { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn remain_active_flag(s: Span) -> IResult<Span, RemainActiveFlag> {
|
pub(crate) fn remain_active_flag(s: Span) -> IResult<Span, RemainActiveFlag> {
|
||||||
let (s, a) = constant_mintypmax_expression(s)?;
|
let (s, a) = constant_mintypmax_expression(s)?;
|
||||||
Ok((s, RemainActiveFlag { nodes: (a,) }))
|
Ok((s, RemainActiveFlag { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timestamp_condition(s: Span) -> IResult<Span, TimestampCondition> {
|
pub(crate) fn timestamp_condition(s: Span) -> IResult<Span, TimestampCondition> {
|
||||||
let (s, a) = mintypmax_expression(s)?;
|
let (s, a) = mintypmax_expression(s)?;
|
||||||
Ok((s, TimestampCondition { nodes: (a,) }))
|
Ok((s, TimestampCondition { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn start_edge_offset(s: Span) -> IResult<Span, StartEdgeOffset> {
|
pub(crate) fn start_edge_offset(s: Span) -> IResult<Span, StartEdgeOffset> {
|
||||||
let (s, a) = mintypmax_expression(s)?;
|
let (s, a) = mintypmax_expression(s)?;
|
||||||
Ok((s, StartEdgeOffset { nodes: (a,) }))
|
Ok((s, StartEdgeOffset { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn threshold(s: Span) -> IResult<Span, Threshold> {
|
pub(crate) fn threshold(s: Span) -> IResult<Span, Threshold> {
|
||||||
let (s, a) = constant_expression(s)?;
|
let (s, a) = constant_expression(s)?;
|
||||||
Ok((s, Threshold { nodes: (a,) }))
|
Ok((s, Threshold { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timing_check_limit(s: Span) -> IResult<Span, TimingCheckLimit> {
|
pub(crate) fn timing_check_limit(s: Span) -> IResult<Span, TimingCheckLimit> {
|
||||||
let (s, a) = expression(s)?;
|
let (s, a) = expression(s)?;
|
||||||
Ok((s, TimingCheckLimit { nodes: (a,) }))
|
Ok((s, TimingCheckLimit { nodes: (a,) }))
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
|
pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
|
||||||
alt((
|
alt((
|
||||||
map(setup_timing_check, |x| {
|
map(setup_timing_check, |x| {
|
||||||
@ -45,6 +46,7 @@ pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
|
pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
|
||||||
let (s, a) = keyword("$setup")(s)?;
|
let (s, a) = keyword("$setup")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -60,6 +62,7 @@ pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
|
pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
|
||||||
let (s, a) = keyword("$setup")(s)?;
|
let (s, a) = keyword("$setup")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -75,6 +78,7 @@ pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
|
pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
|
||||||
let (s, a) = keyword("$setuphold")(s)?;
|
let (s, a) = keyword("$setuphold")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -108,6 +112,7 @@ pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCh
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
|
pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
|
||||||
let (s, a) = keyword("$recovery")(s)?;
|
let (s, a) = keyword("$recovery")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -123,6 +128,7 @@ pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingChec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
|
pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
|
||||||
let (s, a) = keyword("$removal")(s)?;
|
let (s, a) = keyword("$removal")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -138,6 +144,7 @@ pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
|
pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
|
||||||
let (s, a) = keyword("$recrem")(s)?;
|
let (s, a) = keyword("$recrem")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -171,6 +178,7 @@ pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
|
pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
|
||||||
let (s, a) = keyword("$skew")(s)?;
|
let (s, a) = keyword("$skew")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -186,6 +194,7 @@ pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
|
pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
|
||||||
let (s, a) = keyword("$timeskew")(s)?;
|
let (s, a) = keyword("$timeskew")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -209,6 +218,7 @@ pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingChec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
|
pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
|
||||||
let (s, a) = keyword("$fullskew")(s)?;
|
let (s, a) = keyword("$fullskew")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -234,6 +244,7 @@ pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingChec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
|
pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
|
||||||
let (s, a) = keyword("$period")(s)?;
|
let (s, a) = keyword("$period")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -247,6 +258,7 @@ pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
|
pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
|
||||||
let (s, a) = keyword("$width")(s)?;
|
let (s, a) = keyword("$width")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
@ -262,6 +274,7 @@ pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
|
pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
|
||||||
let (s, a) = keyword("$nocharge")(s)?;
|
let (s, a) = keyword("$nocharge")(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
|
pub(crate) fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
|
||||||
let (s, a) = opt(timing_check_event_control)(s)?;
|
let (s, a) = opt(timing_check_event_control)(s)?;
|
||||||
let (s, b) = specify_terminal_descriptor(s)?;
|
let (s, b) = specify_terminal_descriptor(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn controlled_timing_check_event(s: Span) -> IResult<Span, ControlledTimingCheckEvent> {
|
pub(crate) fn controlled_timing_check_event(s: Span) -> IResult<Span, ControlledTimingCheckEvent> {
|
||||||
let (s, a) = timing_check_event_control(s)?;
|
let (s, a) = timing_check_event_control(s)?;
|
||||||
let (s, b) = specify_terminal_descriptor(s)?;
|
let (s, b) = specify_terminal_descriptor(s)?;
|
||||||
@ -19,6 +21,7 @@ pub(crate) fn controlled_timing_check_event(s: Span) -> IResult<Span, Controlled
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventControl> {
|
pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventControl> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("posedge"), |x| {
|
map(keyword("posedge"), |x| {
|
||||||
@ -37,6 +40,7 @@ pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEv
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDescriptor> {
|
pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDescriptor> {
|
||||||
alt((
|
alt((
|
||||||
map(specify_input_terminal_descriptor, |x| {
|
map(specify_input_terminal_descriptor, |x| {
|
||||||
@ -49,6 +53,7 @@ pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTermi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_control_specifier(s: Span) -> IResult<Span, EdgeControlSpecifier> {
|
pub(crate) fn edge_control_specifier(s: Span) -> IResult<Span, EdgeControlSpecifier> {
|
||||||
let (s, a) = keyword("edge")(s)?;
|
let (s, a) = keyword("edge")(s)?;
|
||||||
let (s, b) = bracket(list(symbol(","), edge_descriptor))(s)?;
|
let (s, b) = bracket(list(symbol(","), edge_descriptor))(s)?;
|
||||||
@ -56,6 +61,7 @@ pub(crate) fn edge_control_specifier(s: Span) -> IResult<Span, EdgeControlSpecif
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
|
pub(crate) fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("01"), |x| EdgeDescriptor { nodes: (x,) }),
|
map(keyword("01"), |x| EdgeDescriptor { nodes: (x,) }),
|
||||||
@ -80,6 +86,7 @@ pub(crate) fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
|
pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
|
||||||
alt((
|
alt((
|
||||||
map(scalar_timing_check_condition, |x| {
|
map(scalar_timing_check_condition, |x| {
|
||||||
@ -90,6 +97,7 @@ pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondit
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckCondition> {
|
pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckCondition> {
|
||||||
let (s, a) = paren(scalar_timing_check_condition)(s)?;
|
let (s, a) = paren(scalar_timing_check_condition)(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -99,6 +107,7 @@ pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheck
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
|
pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
|
||||||
alt((
|
alt((
|
||||||
map(expression, |x| {
|
map(expression, |x| {
|
||||||
@ -110,6 +119,7 @@ pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimi
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn scalar_timing_check_condition_unary(
|
pub(crate) fn scalar_timing_check_condition_unary(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ScalarTimingCheckCondition> {
|
) -> IResult<Span, ScalarTimingCheckCondition> {
|
||||||
@ -124,6 +134,7 @@ pub(crate) fn scalar_timing_check_condition_unary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn scalar_timing_check_condition_binary(
|
pub(crate) fn scalar_timing_check_condition_binary(
|
||||||
s: Span,
|
s: Span,
|
||||||
) -> IResult<Span, ScalarTimingCheckCondition> {
|
) -> IResult<Span, ScalarTimingCheckCondition> {
|
||||||
@ -139,6 +150,7 @@ pub(crate) fn scalar_timing_check_condition_binary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn scalar_constant(s: Span) -> IResult<Span, ScalarConstant> {
|
pub(crate) fn scalar_constant(s: Span) -> IResult<Span, ScalarConstant> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("1'b0"), |x| ScalarConstant { nodes: (x,) }),
|
map(keyword("1'b0"), |x| ScalarConstant { nodes: (x,) }),
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
|
pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
|
||||||
alt((
|
alt((
|
||||||
map(combinational_body, |x| {
|
map(combinational_body, |x| {
|
||||||
@ -13,6 +14,7 @@ pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
|
pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
|
||||||
let (s, a) = keyword("table")(s)?;
|
let (s, a) = keyword("table")(s)?;
|
||||||
let (s, b) = combinational_entry(s)?;
|
let (s, b) = combinational_entry(s)?;
|
||||||
@ -27,6 +29,7 @@ pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
|
pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
|
||||||
let (s, a) = level_input_list(s)?;
|
let (s, a) = level_input_list(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -41,6 +44,7 @@ pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
|
pub(crate) fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
|
||||||
let (s, a) = opt(udp_initial_statement)(s)?;
|
let (s, a) = opt(udp_initial_statement)(s)?;
|
||||||
let (s, b) = keyword("table")(s)?;
|
let (s, b) = keyword("table")(s)?;
|
||||||
@ -56,6 +60,7 @@ pub(crate) fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
|
pub(crate) fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
|
||||||
let (s, a) = keyword("initial")(s)?;
|
let (s, a) = keyword("initial")(s)?;
|
||||||
let (s, b) = output_port_identifier(s)?;
|
let (s, b) = output_port_identifier(s)?;
|
||||||
@ -71,6 +76,7 @@ pub(crate) fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
|
pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("1'b0"), |x| InitVal { nodes: (x,) }),
|
map(keyword("1'b0"), |x| InitVal { nodes: (x,) }),
|
||||||
@ -87,6 +93,7 @@ pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
|
pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
|
||||||
let (s, a) = seq_input_list(s)?;
|
let (s, a) = seq_input_list(s)?;
|
||||||
let (s, b) = symbol(":")(s)?;
|
let (s, b) = symbol(":")(s)?;
|
||||||
@ -103,6 +110,7 @@ pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
|
pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
|
||||||
alt((
|
alt((
|
||||||
map(level_input_list, |x| {
|
map(level_input_list, |x| {
|
||||||
@ -115,6 +123,7 @@ pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn level_input_list(s: Span) -> IResult<Span, LevelInputList> {
|
pub(crate) fn level_input_list(s: Span) -> IResult<Span, LevelInputList> {
|
||||||
let (s, a) = level_symbol(s)?;
|
let (s, a) = level_symbol(s)?;
|
||||||
let (s, b) = many0(level_symbol)(s)?;
|
let (s, b) = many0(level_symbol)(s)?;
|
||||||
@ -122,6 +131,7 @@ pub(crate) fn level_input_list(s: Span) -> IResult<Span, LevelInputList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
|
pub(crate) fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
|
||||||
let (s, a) = many0(level_symbol)(s)?;
|
let (s, a) = many0(level_symbol)(s)?;
|
||||||
let (s, b) = edge_indicator(s)?;
|
let (s, b) = edge_indicator(s)?;
|
||||||
@ -130,6 +140,7 @@ pub(crate) fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
|
pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
|
||||||
alt((
|
alt((
|
||||||
edge_indicator_paren,
|
edge_indicator_paren,
|
||||||
@ -138,6 +149,7 @@ pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
|
pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
|
||||||
let (s, a) = paren(pair(level_symbol, level_symbol))(s)?;
|
let (s, a) = paren(pair(level_symbol, level_symbol))(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -147,12 +159,14 @@ pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn current_state(s: Span) -> IResult<Span, CurrentState> {
|
pub(crate) fn current_state(s: Span) -> IResult<Span, CurrentState> {
|
||||||
let (s, a) = level_symbol(s)?;
|
let (s, a) = level_symbol(s)?;
|
||||||
Ok((s, CurrentState { nodes: (a,) }))
|
Ok((s, CurrentState { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
|
pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
|
||||||
alt((
|
alt((
|
||||||
map(output_symbol, |x| NextState::OutputSymbol(Box::new(x))),
|
map(output_symbol, |x| NextState::OutputSymbol(Box::new(x))),
|
||||||
@ -161,6 +175,7 @@ pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
|
pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("0"), |x| OutputSymbol { nodes: (x,) }),
|
map(keyword("0"), |x| OutputSymbol { nodes: (x,) }),
|
||||||
@ -171,6 +186,7 @@ pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
|
pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("0"), |x| LevelSymbol { nodes: (x,) }),
|
map(keyword("0"), |x| LevelSymbol { nodes: (x,) }),
|
||||||
@ -184,6 +200,7 @@ pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
|
pub(crate) fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
|
||||||
alt((
|
alt((
|
||||||
map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }),
|
map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }),
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration> {
|
pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("primitive")(s)?;
|
let (s, b) = keyword("primitive")(s)?;
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
|
pub(crate) fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("primitive")(s)?;
|
let (s, b) = keyword("primitive")(s)?;
|
||||||
@ -33,6 +35,7 @@ pub(crate) fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
udp_declaration_nonansi,
|
udp_declaration_nonansi,
|
||||||
@ -44,6 +47,7 @@ pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
let (s, a) = udp_nonansi_declaration(s)?;
|
let (s, a) = udp_nonansi_declaration(s)?;
|
||||||
let (s, b) = udp_port_declaration(s)?;
|
let (s, b) = udp_port_declaration(s)?;
|
||||||
@ -60,6 +64,7 @@ pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
let (s, a) = udp_ansi_declaration(s)?;
|
let (s, a) = udp_ansi_declaration(s)?;
|
||||||
let (s, b) = udp_body(s)?;
|
let (s, b) = udp_body(s)?;
|
||||||
@ -74,6 +79,7 @@ pub(crate) fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = udp_nonansi_declaration(s)?;
|
let (s, b) = udp_nonansi_declaration(s)?;
|
||||||
@ -84,6 +90,7 @@ pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
let (s, a) = keyword("extern")(s)?;
|
let (s, a) = keyword("extern")(s)?;
|
||||||
let (s, b) = udp_ansi_declaration(s)?;
|
let (s, b) = udp_ansi_declaration(s)?;
|
||||||
@ -94,6 +101,7 @@ pub(crate) fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclarati
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_wildcard(s: Span) -> IResult<Span, UdpDeclaration> {
|
pub(crate) fn udp_declaration_wildcard(s: Span) -> IResult<Span, UdpDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("primitive")(s)?;
|
let (s, b) = keyword("primitive")(s)?;
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
|
pub(crate) fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
|
||||||
let (s, a) = udp_identifier(s)?;
|
let (s, a) = udp_identifier(s)?;
|
||||||
let (s, b) = opt(drive_strength)(s)?;
|
let (s, b) = opt(drive_strength)(s)?;
|
||||||
@ -18,6 +19,7 @@ pub(crate) fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_instance(s: Span) -> IResult<Span, UdpInstance> {
|
pub(crate) fn udp_instance(s: Span) -> IResult<Span, UdpInstance> {
|
||||||
let (s, a) = opt(name_of_instance)(s)?;
|
let (s, a) = opt(name_of_instance)(s)?;
|
||||||
let (s, b) = paren(tuple((
|
let (s, b) = paren(tuple((
|
||||||
|
@ -3,6 +3,7 @@ use crate::*;
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
|
pub(crate) fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
|
||||||
let (s, a) = output_port_identifier(s)?;
|
let (s, a) = output_port_identifier(s)?;
|
||||||
let (s, b) = symbol(",")(s)?;
|
let (s, b) = symbol(",")(s)?;
|
||||||
@ -11,6 +12,7 @@ pub(crate) fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortList> {
|
pub(crate) fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortList> {
|
||||||
let (s, a) = udp_output_declaration(s)?;
|
let (s, a) = udp_output_declaration(s)?;
|
||||||
let (s, b) = symbol(",")(s)?;
|
let (s, b) = symbol(",")(s)?;
|
||||||
@ -19,6 +21,7 @@ pub(crate) fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclaration
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
|
pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
|
||||||
alt((
|
alt((
|
||||||
map(pair(udp_output_declaration, symbol(";")), |x| {
|
map(pair(udp_output_declaration, symbol(";")), |x| {
|
||||||
@ -34,11 +37,13 @@ pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_output_declaration(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
pub(crate) fn udp_output_declaration(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
||||||
alt((udp_output_declaration_nonreg, udp_output_declaration_reg))(s)
|
alt((udp_output_declaration_nonreg, udp_output_declaration_reg))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("output")(s)?;
|
let (s, b) = keyword("output")(s)?;
|
||||||
@ -50,6 +55,7 @@ pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputD
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
pub(crate) fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("output")(s)?;
|
let (s, b) = keyword("output")(s)?;
|
||||||
@ -65,6 +71,7 @@ pub(crate) fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDecl
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
|
pub(crate) fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("input")(s)?;
|
let (s, b) = keyword("input")(s)?;
|
||||||
@ -73,6 +80,7 @@ pub(crate) fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaratio
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn udp_reg_declaration(s: Span) -> IResult<Span, UdpRegDeclaration> {
|
pub(crate) fn udp_reg_declaration(s: Span) -> IResult<Span, UdpRegDeclaration> {
|
||||||
let (s, a) = many0(attribute_instance)(s)?;
|
let (s, a) = many0(attribute_instance)(s)?;
|
||||||
let (s, b) = keyword("reg")(s)?;
|
let (s, b) = keyword("reg")(s)?;
|
||||||
|
@ -507,6 +507,7 @@ where
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
|
#[packrat_parser]
|
||||||
pub(crate) fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
|
pub(crate) fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
|
||||||
alt((
|
alt((
|
||||||
map(multispace1, |x: Span| {
|
map(multispace1, |x: Span| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user