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
a863321d
Commit
a863321d
authored
Jul 06, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combine handling of concatenation LHSs
parent
df2524ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
src/Language/SystemVerilog/Parser/Parse.y
+10
-8
src/Language/SystemVerilog/Parser/ParseDecl.hs
+4
-7
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
a863321d
...
...
@@ -642,7 +642,8 @@ DeclToken :: { DeclToken }
|
PartSelectP
{
uncurry
(
DTRange
$
fst
$
1
)
(
snd
$
1
)
}
|
IdentifierP
{
uncurry
DTIdent
$
1
}
|
DirectionP
{
uncurry
DTDir
$
1
}
|
LHSConcatP
{
uncurry
DTConcat
$
1
}
|
LHSConcatP
{
uncurry
DTLHSBase
$
1
}
|
LHSStreamP
{
uncurry
DTLHSBase
$
1
}
|
PartialTypeP
{
uncurry
DTType
$
1
}
|
NetTypeP
Strength
{
uncurry
DTNet
$
1
$
2
}
|
PortBindingsP
{
uncurry
DTPorts
$
1
}
...
...
@@ -650,8 +651,6 @@ DeclToken :: { DeclToken }
|
"["
Expr
"]"
{
DTBit
(
tokenPosition
$
1
)
$
2
}
|
"."
Identifier
{
DTDot
(
tokenPosition
$
1
)
$
2
}
|
"automatic"
{
DTLifetime
(
tokenPosition
$
1
)
Automatic
}
|
"{"
StreamOp
StreamSize
Concat
"}"
{
DTStream
(
tokenPosition
$
1
)
$
2
$
3
(
map
toLHS
$
4
)
}
|
"{"
StreamOp
Concat
"}"
{
DTStream
(
tokenPosition
$
1
)
$
2
(
RawNum
1
)
(
map
toLHS
$
3
)
}
|
"type"
"("
Expr
")"
{
uncurry
DTType
$
makeTypeOf
$
1
$
3
}
|
IncOrDecOperatorP
{
DTAsgn
(
fst
$
1
)
(
AsgnOp
$
snd
$
1
)
Nothing
(
RawNum
1
)
}
|
IdentifierP
"::"
Identifier
{
uncurry
DTPSIdent
$
1
$
3
}
...
...
@@ -990,12 +989,15 @@ LHS :: { LHS }
|
LHS
PartSelectP
{
uncurry
(
LHSRange
$
1
)
(
snd
$
2
)
}
|
LHS
"["
Expr
"]"
{
LHSBit
$
1
$
3
}
|
LHS
"."
Identifier
{
LHSDot
$
1
$
3
}
|
LHSConcatP
{
LHSConcat
$
snd
$
1
}
|
"{"
StreamOp
StreamSize
Concat
"}"
{
LHSStream
$
2
$
3
(
map
toLHS
$
4
)
}
|
"{"
StreamOp
Concat
"}"
{
LHSStream
$
2
(
RawNum
1
)
(
map
toLHS
$
3
)
}
|
LHSConcatP
{
snd
$
1
}
|
LHSStreamP
{
snd
$
1
}
LHSConcatP
::
{
(
Position
,
[
LHS
])
}
:
"{"
LHSs
"}"
{
withPos
$
1
$
2
}
LHSStreamP
::
{
(
Position
,
LHS
)
}
:
"{"
StreamOp
StreamSize
Concat
"}"
{
withPos
$
1
$
LHSStream
$
2
$
3
(
map
toLHS
$
4
)
}
|
"{"
StreamOp
Concat
"}"
{
withPos
$
1
$
LHSStream
$
2
(
RawNum
1
)
(
map
toLHS
$
3
)
}
LHSConcatP
::
{
(
Position
,
LHS
)
}
:
"{"
LHSs
"}"
{
withPos
$
1
$
LHSConcat
$
2
}
LHSs
::
{
[
LHS
]
}
:
LHS
{
[
$
1
]
}
|
LHSs
","
LHS
{
$
1
++
[
$
3
]
}
...
...
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
a863321d
...
...
@@ -66,8 +66,7 @@ data DeclToken
|
DTParams
Position
[
ParamBinding
]
|
DTPorts
Position
[
PortBinding
]
|
DTBit
Position
Expr
|
DTConcat
Position
[
LHS
]
|
DTStream
Position
StreamOp
Expr
[
LHS
]
|
DTLHSBase
Position
LHS
|
DTDot
Position
Identifier
|
DTSigning
Position
Signing
|
DTLifetime
Position
Lifetime
...
...
@@ -357,9 +356,8 @@ takeLHS tokens = takeLHSStep (takeLHSStart tok) toks
where
tok
:
toks
=
tokens
takeLHSStart
::
DeclToken
->
LHS
takeLHSStart
(
DTConcat
_
lhss
)
=
LHSConcat
lhss
takeLHSStart
(
DTStream
_
o
e
lhss
)
=
LHSStream
o
e
lhss
takeLHSStart
(
DTIdent
_
x
)
=
LHSIdent
x
takeLHSStart
(
DTLHSBase
_
lhs
)
=
lhs
takeLHSStart
(
DTIdent
_
x
)
=
LHSIdent
x
takeLHSStart
tok
=
parseError
tok
"expected primary token or type"
takeLHSStep
::
LHS
->
[
DeclToken
]
->
(
LHS
,
[
DeclToken
])
...
...
@@ -580,8 +578,7 @@ tokPos (DTNet p _ _) = p
tokPos
(
DTParams
p
_
)
=
p
tokPos
(
DTPorts
p
_
)
=
p
tokPos
(
DTBit
p
_
)
=
p
tokPos
(
DTConcat
p
_
)
=
p
tokPos
(
DTStream
p
_
_
_
)
=
p
tokPos
(
DTLHSBase
p
_
)
=
p
tokPos
(
DTDot
p
_
)
=
p
tokPos
(
DTSigning
p
_
)
=
p
tokPos
(
DTLifetime
p
_
)
=
p
...
...
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