Fix data_type_or_implicit
This commit is contained in:
parent
bdddb4a8ce
commit
2a36aad0cc
@ -11,7 +11,6 @@ trace = ["nom-tracable/trace"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "5.0.0"
|
nom = "5.0.0"
|
||||||
nom_locate = "0.4.0"
|
nom_locate = "0.4.0"
|
||||||
nom-both = {path = "../../nom-both/nom-both"}
|
|
||||||
nom-packrat = {path = "../../nom-packrat/nom-packrat"}
|
nom-packrat = {path = "../../nom-packrat/nom-packrat"}
|
||||||
nom-recursive = {path = "../../nom-recursive/nom-recursive"}
|
nom-recursive = {path = "../../nom-recursive/nom-recursive"}
|
||||||
nom-tracable = {path = "../../nom-tracable/nom-tracable"}
|
nom-tracable = {path = "../../nom-tracable/nom-tracable"}
|
||||||
|
@ -234,12 +234,11 @@ pub(crate) fn property_port_list(s: Span) -> IResult<Span, PropertyPortList> {
|
|||||||
Ok((s, PropertyPortList { nodes: (a,) }))
|
Ok((s, PropertyPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = both_opt(property_formal_type)(s)?;
|
let (s, c) = property_formal_type(s)?;
|
||||||
let (s, d) = formal_port_identifier(s)?;
|
let (s, d) = formal_port_identifier(s)?;
|
||||||
let (s, e) = many0(variable_dimension)(s)?;
|
let (s, e) = many0(variable_dimension)(s)?;
|
||||||
let (s, f) = opt(pair(symbol("="), property_actual_arg))(s)?;
|
let (s, f) = opt(pair(symbol("="), property_actual_arg))(s)?;
|
||||||
@ -724,12 +723,11 @@ pub(crate) fn sequence_port_list(s: Span) -> IResult<Span, SequencePortList> {
|
|||||||
Ok((s, SequencePortList { nodes: (a,) }))
|
Ok((s, SequencePortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = both_opt(sequence_formal_type)(s)?;
|
let (s, c) = sequence_formal_type(s)?;
|
||||||
let (s, d) = formal_port_identifier(s)?;
|
let (s, d) = formal_port_identifier(s)?;
|
||||||
let (s, e) = many0(variable_dimension)(s)?;
|
let (s, e) = many0(variable_dimension)(s)?;
|
||||||
let (s, f) = opt(pair(symbol("="), sequence_actual_arg))(s)?;
|
let (s, f) = opt(pair(symbol("="), sequence_actual_arg))(s)?;
|
||||||
@ -759,7 +757,7 @@ pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLva
|
|||||||
#[tracable_parser]
|
#[tracable_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, |x| {
|
map(data_type_or_implicit_sequence_formal_type, |x| {
|
||||||
SequenceFormalType::DataTypeOrImplicit(Box::new(x))
|
SequenceFormalType::DataTypeOrImplicit(Box::new(x))
|
||||||
}),
|
}),
|
||||||
map(keyword("sequence"), |x| {
|
map(keyword("sequence"), |x| {
|
||||||
@ -771,6 +769,21 @@ pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType>
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_sequence_formal_type(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(formal_port_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(formal_port_identifier)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||||
alt((
|
alt((
|
||||||
|
@ -206,11 +206,10 @@ pub(crate) fn hierarchical_identifier_or_class_scope(
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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(
|
||||||
both_opt(data_type_or_implicit),
|
opt(data_type_or_implicit_cover_point),
|
||||||
cover_point_identifier,
|
cover_point_identifier,
|
||||||
symbol(":"),
|
symbol(":"),
|
||||||
))(s)?;
|
))(s)?;
|
||||||
@ -226,6 +225,19 @@ pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_cover_point(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(cover_point_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(cover_point_identifier)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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((
|
||||||
|
@ -5,12 +5,26 @@ use crate::*;
|
|||||||
#[tracable_parser]
|
#[tracable_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(data_type_or_void, |x| {
|
map(
|
||||||
FunctionDataTypeOrImplicit::DataTypeOrVoid(Box::new(x))
|
terminated(
|
||||||
}),
|
data_type_or_void,
|
||||||
map(implicit_data_type, |x| {
|
peek(pair(
|
||||||
FunctionDataTypeOrImplicit::ImplicitDataType(Box::new(x))
|
opt(interface_identifier_or_class_scope),
|
||||||
}),
|
function_identifier,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
|x| FunctionDataTypeOrImplicit::DataTypeOrVoid(Box::new(x)),
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
terminated(
|
||||||
|
implicit_data_type,
|
||||||
|
peek(pair(
|
||||||
|
opt(interface_identifier_or_class_scope),
|
||||||
|
function_identifier,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
|x| FunctionDataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,12 +44,11 @@ pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDe
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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> {
|
||||||
let (s, a) = both_opt(function_data_type_or_implicit)(s)?;
|
let (s, a) = function_data_type_or_implicit(s)?;
|
||||||
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
|
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
|
||||||
let (s, c) = function_identifier(s)?;
|
let (s, c) = function_identifier(s)?;
|
||||||
let (s, d) = symbol(";")(s)?;
|
let (s, d) = symbol(";")(s)?;
|
||||||
@ -51,12 +64,11 @@ pub(crate) fn function_body_declaration_without_port(
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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> {
|
||||||
let (s, a) = both_opt(function_data_type_or_implicit)(s)?;
|
let (s, a) = function_data_type_or_implicit(s)?;
|
||||||
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
|
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
|
||||||
let (s, c) = function_identifier(s)?;
|
let (s, c) = function_identifier(s)?;
|
||||||
let (s, d) = paren(opt(tf_port_list))(s)?;
|
let (s, d) = paren(opt(tf_port_list))(s)?;
|
||||||
|
@ -30,11 +30,10 @@ pub(crate) fn let_port_list(s: Span) -> IResult<Span, LetPortList> {
|
|||||||
Ok((s, LetPortList { nodes: (a,) }))
|
Ok((s, LetPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_opt(let_formal_type)(s)?;
|
let (s, b) = let_formal_type(s)?;
|
||||||
let (s, c) = formal_port_identifier(s)?;
|
let (s, c) = formal_port_identifier(s)?;
|
||||||
let (s, d) = many0(variable_dimension)(s)?;
|
let (s, d) = many0(variable_dimension)(s)?;
|
||||||
let (s, e) = opt(pair(symbol("="), expression))(s)?;
|
let (s, e) = opt(pair(symbol("="), expression))(s)?;
|
||||||
@ -49,13 +48,26 @@ pub(crate) fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
|
|||||||
#[tracable_parser]
|
#[tracable_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, |x| {
|
map(data_type_or_implicit_let_formal_type, |x| {
|
||||||
LetFormalType::DataTypeOrImplicit(Box::new(x))
|
LetFormalType::DataTypeOrImplicit(Box::new(x))
|
||||||
}),
|
}),
|
||||||
map(keyword("untyped"), |x| LetFormalType::Untyped(Box::new(x))),
|
map(keyword("untyped"), |x| LetFormalType::Untyped(Box::new(x))),
|
||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_let_formal_type(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(formal_port_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(formal_port_identifier)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
|
@ -10,13 +10,12 @@ pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParamet
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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> {
|
||||||
let (s, a) = keyword("localparam")(s)?;
|
let (s, a) = keyword("localparam")(s)?;
|
||||||
let (s, b) = both_opt(data_type_or_implicit)(s)?;
|
let (s, b) = data_type_or_implicit_local_parameter_declaration_param(s)?;
|
||||||
let (s, c) = list_of_param_assignments(s)?;
|
let (s, c) = list_of_param_assignments(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -26,6 +25,21 @@ pub(crate) fn local_parameter_declaration_param(
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_local_parameter_declaration_param(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(param_assignment)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(param_assignment)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
pub(crate) fn local_parameter_declaration_type(
|
pub(crate) fn local_parameter_declaration_type(
|
||||||
s: Span,
|
s: Span,
|
||||||
@ -46,11 +60,10 @@ pub(crate) fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclarati
|
|||||||
alt((parameter_declaration_param, parameter_declaration_type))(s)
|
alt((parameter_declaration_param, parameter_declaration_type))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_opt(data_type_or_implicit)(s)?;
|
let (s, b) = data_type_or_implicit_parameter_declaration_param(s)?;
|
||||||
let (s, c) = list_of_param_assignments(s)?;
|
let (s, c) = list_of_param_assignments(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -58,6 +71,21 @@ pub(crate) fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDec
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_parameter_declaration_param(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(param_assignment)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(param_assignment)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
|
@ -121,6 +121,8 @@ pub(crate) fn data_type_type(s: Span) -> IResult<Span, DataType> {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// all data_type_or_implicit call are specialized for each parser
|
||||||
|
#[allow(dead_code)]
|
||||||
#[tracable_parser]
|
#[tracable_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((
|
||||||
@ -293,13 +295,27 @@ pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
|
|||||||
#[tracable_parser]
|
#[tracable_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(s)?;
|
let (s, b) = data_type_or_implicit_net_port_type_data_type(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
NetPortType::DataType(Box::new(NetPortTypeDataType { nodes: (a, b) })),
|
NetPortType::DataType(Box::new(NetPortTypeDataType { nodes: (a, b) })),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_net_port_type_data_type(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(port_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(terminated(implicit_data_type, peek(port_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::ImplicitDataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
@ -319,7 +335,9 @@ pub(crate) fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
|
|||||||
#[tracable_parser]
|
#[tracable_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(data_type, |x| VarDataType::DataType(Box::new(x))),
|
map(terminated(data_type, peek(variable_identifier)), |x| {
|
||||||
|
VarDataType::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
var_data_type_var,
|
var_data_type_var,
|
||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
@ -327,13 +345,28 @@ pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
|
|||||||
#[tracable_parser]
|
#[tracable_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(s)?;
|
let (s, b) = data_type_or_implicit_var_data_type_var(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
VarDataType::Var(Box::new(VarDataTypeVar { nodes: (a, b) })),
|
VarDataType::Var(Box::new(VarDataTypeVar { nodes: (a, b) })),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_var_data_type_var(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(variable_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(variable_identifier)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
|
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
|
||||||
alt((
|
alt((
|
||||||
|
@ -2,11 +2,10 @@ use crate::*;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_opt(net_port_type)(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
let (s, c) = list_of_port_identifiers(s)?;
|
let (s, c) = list_of_port_identifiers(s)?;
|
||||||
Ok((s, InoutDeclaration { nodes: (a, b, c) }))
|
Ok((s, InoutDeclaration { nodes: (a, b, c) }))
|
||||||
}
|
}
|
||||||
@ -16,11 +15,10 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_opt(net_port_type)(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
let (s, c) = list_of_port_identifiers(s)?;
|
let (s, c) = list_of_port_identifiers(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -28,11 +26,10 @@ pub(crate) fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration>
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_alt(variable_port_type, implicit_var)(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
let (s, c) = list_of_variable_identifiers(s)?;
|
let (s, c) = list_of_variable_identifiers(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -45,11 +42,10 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_opt(net_port_type)(s)?;
|
let (s, b) = net_port_type(s)?;
|
||||||
let (s, c) = list_of_port_identifiers(s)?;
|
let (s, c) = list_of_port_identifiers(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -57,11 +53,10 @@ pub(crate) fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_alt(variable_port_type, implicit_var)(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
let (s, c) = list_of_variable_port_identifiers(s)?;
|
let (s, c) = list_of_variable_port_identifiers(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
s,
|
s,
|
||||||
@ -77,29 +72,10 @@ pub(crate) fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePort
|
|||||||
Ok((s, InterfacePortDeclaration { nodes: (a, b, c) }))
|
Ok((s, InterfacePortDeclaration { nodes: (a, b, c) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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) = both_alt(variable_port_type, implicit_var)(s)?;
|
let (s, b) = variable_port_type(s)?;
|
||||||
let (s, c) = list_of_variable_identifiers(s)?;
|
let (s, c) = list_of_variable_identifiers(s)?;
|
||||||
Ok((s, RefDeclaration { nodes: (a, b, c) }))
|
Ok((s, RefDeclaration { nodes: (a, b, c) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
|
||||||
pub(crate) fn implicit_var(s: Span) -> IResult<Span, VariablePortType> {
|
|
||||||
let (s, a) = keyword("var")(s)?;
|
|
||||||
Ok((
|
|
||||||
s,
|
|
||||||
VariablePortType {
|
|
||||||
nodes: (VarDataType::Var(Box::new(VarDataTypeVar {
|
|
||||||
nodes: (
|
|
||||||
a,
|
|
||||||
DataTypeOrImplicit::ImplicitDataType(Box::new(ImplicitDataType {
|
|
||||||
nodes: (None, vec![]),
|
|
||||||
})),
|
|
||||||
),
|
|
||||||
})),),
|
|
||||||
},
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
@ -71,13 +71,12 @@ pub(crate) fn tf_port_list(s: Span) -> IResult<Span, TfPortList> {
|
|||||||
Ok((s, TfPortList { nodes: (a,) }))
|
Ok((s, TfPortList { nodes: (a,) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = opt(var)(s)?;
|
let (s, c) = opt(var)(s)?;
|
||||||
let (s, d) = both_opt(data_type_or_implicit)(s)?;
|
let (s, d) = data_type_or_implicit_tf_port_item(s)?;
|
||||||
let (s, e) = opt(triple(
|
let (s, e) = opt(triple(
|
||||||
port_identifier,
|
port_identifier,
|
||||||
many0(variable_dimension),
|
many0(variable_dimension),
|
||||||
@ -91,6 +90,40 @@ pub(crate) fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_tf_port_item(s: Span) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(
|
||||||
|
terminated(
|
||||||
|
data_type,
|
||||||
|
peek(pair(
|
||||||
|
opt(triple(
|
||||||
|
port_identifier,
|
||||||
|
many0(variable_dimension),
|
||||||
|
opt(pair(symbol(":"), expression)),
|
||||||
|
)),
|
||||||
|
alt((symbol(","), symbol(")"))),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
|x| DataTypeOrImplicit::DataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
terminated(
|
||||||
|
implicit_data_type,
|
||||||
|
peek(pair(
|
||||||
|
opt(triple(
|
||||||
|
port_identifier,
|
||||||
|
many0(variable_dimension),
|
||||||
|
opt(pair(symbol(":"), expression)),
|
||||||
|
)),
|
||||||
|
alt((symbol(","), symbol(")"))),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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((
|
||||||
@ -103,13 +136,12 @@ pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = opt(var)(s)?;
|
let (s, c) = opt(var)(s)?;
|
||||||
let (s, d) = both_opt(data_type_or_implicit)(s)?;
|
let (s, d) = data_type_or_implicit_tf_port_declaration(s)?;
|
||||||
let (s, e) = list_of_tf_variable_identifiers(s)?;
|
let (s, e) = list_of_tf_variable_identifiers(s)?;
|
||||||
let (s, f) = symbol(";")(s)?;
|
let (s, f) = symbol(";")(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -120,6 +152,21 @@ pub(crate) fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_tf_port_declaration(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(variable_identifier)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(variable_identifier)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
|
@ -18,13 +18,12 @@ pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = opt(lifetime)(s)?;
|
let (s, c) = opt(lifetime)(s)?;
|
||||||
let (s, d) = both_opt(data_type_or_implicit)(s)?;
|
let (s, d) = data_type_or_implicit_data_declaration_variable(s)?;
|
||||||
let (s, e) = list_of_variable_decl_assignments(s)?;
|
let (s, e) = list_of_variable_decl_assignments(s)?;
|
||||||
let (s, f) = symbol(";")(s)?;
|
let (s, f) = symbol(";")(s)?;
|
||||||
Ok((
|
Ok((
|
||||||
@ -35,6 +34,21 @@ pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaratio
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_data_declaration_variable(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(terminated(data_type, peek(variable_decl_assignment)), |x| {
|
||||||
|
DataTypeOrImplicit::DataType(Box::new(x))
|
||||||
|
}),
|
||||||
|
map(
|
||||||
|
terminated(implicit_data_type, peek(variable_decl_assignment)),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
@ -127,13 +141,12 @@ pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
|
|||||||
))(s)
|
))(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[both_parser]
|
|
||||||
#[tracable_parser]
|
#[tracable_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)?;
|
||||||
let (s, c) = opt(vector_scalar)(s)?;
|
let (s, c) = opt(vector_scalar)(s)?;
|
||||||
let (s, d) = both_opt(data_type_or_implicit)(s)?;
|
let (s, d) = data_type_or_implicit_net_declaration_net_type(s)?;
|
||||||
let (s, e) = opt(delay3)(s)?;
|
let (s, e) = opt(delay3)(s)?;
|
||||||
let (s, f) = list_of_net_decl_assignments(s)?;
|
let (s, f) = list_of_net_decl_assignments(s)?;
|
||||||
let (s, g) = symbol(";")(s)?;
|
let (s, g) = symbol(";")(s)?;
|
||||||
@ -145,6 +158,25 @@ pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration>
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracable_parser]
|
||||||
|
pub(crate) fn data_type_or_implicit_net_declaration_net_type(
|
||||||
|
s: Span,
|
||||||
|
) -> IResult<Span, DataTypeOrImplicit> {
|
||||||
|
alt((
|
||||||
|
map(
|
||||||
|
terminated(data_type, peek(pair(opt(delay3), net_decl_assignment))),
|
||||||
|
|x| DataTypeOrImplicit::DataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
map(
|
||||||
|
terminated(
|
||||||
|
implicit_data_type,
|
||||||
|
peek(pair(opt(delay3), net_decl_assignment)),
|
||||||
|
),
|
||||||
|
|x| DataTypeOrImplicit::ImplicitDataType(Box::new(x)),
|
||||||
|
),
|
||||||
|
))(s)
|
||||||
|
}
|
||||||
|
|
||||||
#[tracable_parser]
|
#[tracable_parser]
|
||||||
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
|
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
|
||||||
alt((
|
alt((
|
||||||
|
@ -31,7 +31,6 @@ pub(crate) use nom::error::{make_error, ErrorKind};
|
|||||||
pub(crate) use nom::multi::*;
|
pub(crate) use nom::multi::*;
|
||||||
pub(crate) use nom::sequence::*;
|
pub(crate) use nom::sequence::*;
|
||||||
pub(crate) use nom::{Err, IResult};
|
pub(crate) use nom::{Err, IResult};
|
||||||
pub(crate) use nom_both::both_parser;
|
|
||||||
pub(crate) use nom_packrat::{self, packrat_parser, HasExtraState};
|
pub(crate) use nom_packrat::{self, packrat_parser, HasExtraState};
|
||||||
pub(crate) use nom_recursive::{recursive_parser, HasRecursiveInfo, RecursiveInfo};
|
pub(crate) use nom_recursive::{recursive_parser, HasRecursiveInfo, RecursiveInfo};
|
||||||
pub(crate) use nom_tracable::tracable_parser;
|
pub(crate) use nom_tracable::tracable_parser;
|
||||||
|
@ -803,3 +803,18 @@ fn test_attribute_instance() {
|
|||||||
fn test_expression() {
|
fn test_expression() {
|
||||||
test!(expression, "(!a ? 0 : !b : 1 : c ? 0 : 1)", Ok((_, _)));
|
test!(expression, "(!a ? 0 : !b : 1 : c ? 0 : 1)", Ok((_, _)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_clause3() {
|
||||||
|
test!(
|
||||||
|
module_declaration,
|
||||||
|
r##"module mux2to1 (input wire a, b, sel, // combined port and type declaration
|
||||||
|
output logic y);
|
||||||
|
always_comb begin // procedural block
|
||||||
|
if (sel) y = a; // procedural statement
|
||||||
|
else y = b;
|
||||||
|
end
|
||||||
|
endmodule: mux2to1"##,
|
||||||
|
Ok((_, _))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -129,7 +129,7 @@ pub struct PropertyPortItem {
|
|||||||
pub nodes: (
|
pub nodes: (
|
||||||
Vec<AttributeInstance>,
|
Vec<AttributeInstance>,
|
||||||
Option<(Local, Option<PropertyLvarPortDirection>)>,
|
Option<(Local, Option<PropertyLvarPortDirection>)>,
|
||||||
Option<PropertyFormalType>,
|
PropertyFormalType,
|
||||||
FormalPortIdentifier,
|
FormalPortIdentifier,
|
||||||
Vec<VariableDimension>,
|
Vec<VariableDimension>,
|
||||||
Option<(Symbol, PropertyActualArg)>,
|
Option<(Symbol, PropertyActualArg)>,
|
||||||
@ -400,7 +400,7 @@ pub struct SequencePortItem {
|
|||||||
pub nodes: (
|
pub nodes: (
|
||||||
Vec<AttributeInstance>,
|
Vec<AttributeInstance>,
|
||||||
Option<(Local, Option<SequenceLvarPortDirection>)>,
|
Option<(Local, Option<SequenceLvarPortDirection>)>,
|
||||||
Option<SequenceFormalType>,
|
SequenceFormalType,
|
||||||
FormalPortIdentifier,
|
FormalPortIdentifier,
|
||||||
Vec<VariableDimension>,
|
Vec<VariableDimension>,
|
||||||
Option<(Symbol, SequenceActualArg)>,
|
Option<(Symbol, SequenceActualArg)>,
|
||||||
|
@ -22,7 +22,7 @@ pub enum FunctionBodyDeclaration {
|
|||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct FunctionBodyDeclarationWithoutPort {
|
pub struct FunctionBodyDeclarationWithoutPort {
|
||||||
pub nodes: (
|
pub nodes: (
|
||||||
Option<FunctionDataTypeOrImplicit>,
|
FunctionDataTypeOrImplicit,
|
||||||
Option<InterfaceIdentifierOrClassScope>,
|
Option<InterfaceIdentifierOrClassScope>,
|
||||||
FunctionIdentifier,
|
FunctionIdentifier,
|
||||||
Symbol,
|
Symbol,
|
||||||
@ -36,7 +36,7 @@ pub struct FunctionBodyDeclarationWithoutPort {
|
|||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct FunctionBodyDeclarationWithPort {
|
pub struct FunctionBodyDeclarationWithPort {
|
||||||
pub nodes: (
|
pub nodes: (
|
||||||
Option<FunctionDataTypeOrImplicit>,
|
FunctionDataTypeOrImplicit,
|
||||||
Option<InterfaceIdentifierOrClassScope>,
|
Option<InterfaceIdentifierOrClassScope>,
|
||||||
FunctionIdentifier,
|
FunctionIdentifier,
|
||||||
Paren<Option<TfPortList>>,
|
Paren<Option<TfPortList>>,
|
||||||
|
@ -28,7 +28,7 @@ pub struct LetPortList {
|
|||||||
pub struct LetPortItem {
|
pub struct LetPortItem {
|
||||||
pub nodes: (
|
pub nodes: (
|
||||||
Vec<AttributeInstance>,
|
Vec<AttributeInstance>,
|
||||||
Option<LetFormalType>,
|
LetFormalType,
|
||||||
FormalPortIdentifier,
|
FormalPortIdentifier,
|
||||||
Vec<VariableDimension>,
|
Vec<VariableDimension>,
|
||||||
Option<(Symbol, Expression)>,
|
Option<(Symbol, Expression)>,
|
||||||
|
@ -10,7 +10,7 @@ pub enum LocalParameterDeclaration {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct LocalParameterDeclarationParam {
|
pub struct LocalParameterDeclarationParam {
|
||||||
pub nodes: (Keyword, Option<DataTypeOrImplicit>, ListOfParamAssignments),
|
pub nodes: (Keyword, DataTypeOrImplicit, ListOfParamAssignments),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
@ -26,7 +26,7 @@ pub enum ParameterDeclaration {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct ParameterDeclarationParam {
|
pub struct ParameterDeclarationParam {
|
||||||
pub nodes: (Keyword, Option<DataTypeOrImplicit>, ListOfParamAssignments),
|
pub nodes: (Keyword, DataTypeOrImplicit, ListOfParamAssignments),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
|
@ -4,7 +4,7 @@ use crate::*;
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct InoutDeclaration {
|
pub struct InoutDeclaration {
|
||||||
pub nodes: (Keyword, Option<NetPortType>, ListOfPortIdentifiers),
|
pub nodes: (Keyword, NetPortType, ListOfPortIdentifiers),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
@ -15,7 +15,7 @@ pub enum InputDeclaration {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct InputDeclarationNet {
|
pub struct InputDeclarationNet {
|
||||||
pub nodes: (Keyword, Option<NetPortType>, ListOfPortIdentifiers),
|
pub nodes: (Keyword, NetPortType, ListOfPortIdentifiers),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
@ -31,7 +31,7 @@ pub enum OutputDeclaration {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
pub struct OutputDeclarationNet {
|
pub struct OutputDeclarationNet {
|
||||||
pub nodes: (Keyword, Option<NetPortType>, ListOfPortIdentifiers),
|
pub nodes: (Keyword, NetPortType, ListOfPortIdentifiers),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Node)]
|
#[derive(Clone, Debug, Node)]
|
||||||
|
@ -57,7 +57,7 @@ pub struct TfPortItem {
|
|||||||
Vec<AttributeInstance>,
|
Vec<AttributeInstance>,
|
||||||
Option<TfPortDirection>,
|
Option<TfPortDirection>,
|
||||||
Option<Var>,
|
Option<Var>,
|
||||||
Option<DataTypeOrImplicit>,
|
DataTypeOrImplicit,
|
||||||
Option<(
|
Option<(
|
||||||
PortIdentifier,
|
PortIdentifier,
|
||||||
Vec<VariableDimension>,
|
Vec<VariableDimension>,
|
||||||
@ -78,7 +78,7 @@ pub struct TfPortDeclaration {
|
|||||||
Vec<AttributeInstance>,
|
Vec<AttributeInstance>,
|
||||||
TfPortDirection,
|
TfPortDirection,
|
||||||
Option<Var>,
|
Option<Var>,
|
||||||
Option<DataTypeOrImplicit>,
|
DataTypeOrImplicit,
|
||||||
ListOfTfVariableIdentifiers,
|
ListOfTfVariableIdentifiers,
|
||||||
Symbol,
|
Symbol,
|
||||||
),
|
),
|
||||||
|
@ -16,7 +16,7 @@ pub struct DataDeclarationVariable {
|
|||||||
Option<Const>,
|
Option<Const>,
|
||||||
Option<Var>,
|
Option<Var>,
|
||||||
Option<Lifetime>,
|
Option<Lifetime>,
|
||||||
Option<DataTypeOrImplicit>,
|
DataTypeOrImplicit,
|
||||||
ListOfVariableDeclAssignments,
|
ListOfVariableDeclAssignments,
|
||||||
Symbol,
|
Symbol,
|
||||||
),
|
),
|
||||||
@ -82,7 +82,7 @@ pub struct NetDeclarationNetType {
|
|||||||
NetType,
|
NetType,
|
||||||
Option<Strength>,
|
Option<Strength>,
|
||||||
Option<VectorScalar>,
|
Option<VectorScalar>,
|
||||||
Option<DataTypeOrImplicit>,
|
DataTypeOrImplicit,
|
||||||
Option<Delay3>,
|
Option<Delay3>,
|
||||||
ListOfNetDeclAssignments,
|
ListOfNetDeclAssignments,
|
||||||
Symbol,
|
Symbol,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user