Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
sv2v
Commits
943b7adc
Commit
943b7adc
authored
Mar 08, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for more complex LHSs with dots in decl token parser
parent
2150e8a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/Language/SystemVerilog/Parser/Parse.y
+1
-1
src/Language/SystemVerilog/Parser/ParseDecl.hs
+3
-4
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
943b7adc
...
...
@@ -293,7 +293,7 @@ DeclOrStmtToken :: { DeclToken }
| "[" Expr "]" { DTBit $2 }
| "{" LHSs "}" { DTConcat $2 }
| PartialType { DTType $1 }
|
Identifier "." Identifier { DTType $ InterfaceT $1 (Just $3)
}
|
"." Identifier { DTDot $2
}
VariablePortIdentifiers :: { [(Identifier, Maybe Expr)] }
: VariablePortIdentifier { [$1] }
...
...
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
943b7adc
...
...
@@ -56,6 +56,7 @@ data DeclToken
|
DTInstance
(
Identifier
,
[
PortBinding
])
|
DTBit
Expr
|
DTConcat
[
LHS
]
|
DTDot
Identifier
deriving
(
Show
,
Eq
)
...
...
@@ -185,10 +186,7 @@ takeLHSStep (Nothing ) (DTConcat lhss) = Just $ LHSConcat lhss
takeLHSStep
(
Nothing
)
(
DTIdent
x
)
=
Just
$
LHSIdent
x
takeLHSStep
(
Just
curr
)
(
DTBit
e
)
=
Just
$
LHSBit
curr
e
takeLHSStep
(
Just
curr
)
(
DTRange
r
)
=
Just
$
LHSRange
curr
r
takeLHSStep
(
Nothing
)
(
DTType
tf
)
=
case
tf
[]
of
InterfaceT
x
(
Just
y
)
[]
->
Just
$
LHSDot
(
LHSIdent
x
)
y
_
->
error
$
"unexpected type in assignment: "
++
(
show
tf
)
takeLHSStep
(
Just
curr
)
(
DTDot
x
)
=
Just
$
LHSDot
curr
x
takeLHSStep
(
maybeCurr
)
token
=
error
$
"unexpected token in LHS: "
++
show
(
maybeCurr
,
token
)
...
...
@@ -255,6 +253,7 @@ takeDir (DTDir dir : rest) = (dir , rest)
takeDir
rest
=
(
Local
,
rest
)
takeType
::
[
DeclToken
]
->
([
Range
]
->
Type
,
[
DeclToken
])
takeType
(
DTIdent
a
:
DTDot
b
:
rest
)
=
(
InterfaceT
a
(
Just
b
),
rest
)
takeType
(
DTType
tf
:
rest
)
=
(
tf
,
rest
)
takeType
(
DTIdent
tn
:
DTComma
:
rest
)
=
(
Implicit
,
DTIdent
tn
:
DTComma
:
rest
)
takeType
(
DTIdent
tn
:
[ ]
)
=
(
Implicit
,
DTIdent
tn
:
[ ]
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment