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
bce438c8
Commit
bce438c8
authored
Sep 24, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default case can be anywhere in case block
parent
2d8e6bdd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/Language/SystemVerilog/Parser/Parse.y
+10
-2
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
bce438c8
...
@@ -890,7 +890,7 @@ StmtNonAsgn :: { Stmt }
...
@@ -890,7 +890,7 @@ StmtNonAsgn :: { Stmt }
| Unique "if" "(" Expr ")" Stmt %prec NoElse { If $1 $4 $6 Null }
| Unique "if" "(" Expr ")" Stmt %prec NoElse { If $1 $4 $6 Null }
| "for" "(" ";" opt(Expr) ";" ForStep ")" Stmt { For [] $4 $6 $8 }
| "for" "(" ";" opt(Expr) ";" ForStep ")" Stmt { For [] $4 $6 $8 }
| "for" "(" DeclTokens(";") opt(Expr) ";" ForStep ")" Stmt { For (parseDTsAsDeclsAndAsgns $3) $4 $6 $8 }
| "for" "(" DeclTokens(";") opt(Expr) ";" ForStep ")" Stmt { For (parseDTsAsDeclsAndAsgns $3) $4 $6 $8 }
| Unique CaseKW "(" Expr ")" Cases
opt(CaseDefault) "endcase" { Case $1 $2 $4 $6 $7
}
| Unique CaseKW "(" Expr ")" Cases
WithDefault "endcase" { Case $1 $2 $4 (fst $6) (snd $6)
}
| Identifier "(" CallArgs ")" ";" { Subroutine (Nothing) $1 $3 }
| Identifier "(" CallArgs ")" ";" { Subroutine (Nothing) $1 $3 }
| Identifier "::" Identifier "(" CallArgs ")" ";" { Subroutine (Just $1) $3 $5 }
| Identifier "::" Identifier "(" CallArgs ")" ";" { Subroutine (Just $1) $3 $5 }
| TimingControl Stmt { Timing $1 $2 }
| TimingControl Stmt { Timing $1 $2 }
...
@@ -994,6 +994,10 @@ CaseKW :: { CaseKW }
...
@@ -994,6 +994,10 @@ CaseKW :: { CaseKW }
| "casex" { CaseX }
| "casex" { CaseX }
| "casez" { CaseZ }
| "casez" { CaseZ }
CasesWithDefault :: { ([Case], Maybe Stmt) }
: {- empty -} { ([], Nothing) }
| Case CasesWithDefault { ($1 : fst $2, snd $2) }
| CaseDefault Cases { ($2, Just $1) }
Cases :: { [Case] }
Cases :: { [Case] }
: {- empty -} { [] }
: {- empty -} { [] }
| Cases Case { $1 ++ [$2] }
| Cases Case { $1 ++ [$2] }
...
@@ -1146,13 +1150,17 @@ GenItem :: { GenItem }
...
@@ -1146,13 +1150,17 @@ GenItem :: { GenItem }
ConditionalGenerateConstruct :: { GenItem }
ConditionalGenerateConstruct :: { GenItem }
: "if" "(" Expr ")" GenItemOrNull "else" GenItemOrNull { GenIf $3 $5 $7 }
: "if" "(" Expr ")" GenItemOrNull "else" GenItemOrNull { GenIf $3 $5 $7 }
| "if" "(" Expr ")" GenItemOrNull %prec NoElse { GenIf $3 $5 GenNull }
| "if" "(" Expr ")" GenItemOrNull %prec NoElse { GenIf $3 $5 GenNull }
| "case" "(" Expr ")" GenCases
opt(GenCaseDefault) "endcase" { GenCase $3 $5 $6
}
| "case" "(" Expr ")" GenCases
WithDefault "endcase" { GenCase $3 (fst $5) (snd $5)
}
LoopGenerateConstruct :: { GenItem }
LoopGenerateConstruct :: { GenItem }
: "for" "(" GenvarInitialization ";" Expr ";" GenvarIteration ")" GenBlock { (uncurry $ GenFor $3 $5 $7) $9 }
: "for" "(" GenvarInitialization ";" Expr ";" GenvarIteration ")" GenBlock { (uncurry $ GenFor $3 $5 $7) $9 }
GenBlock :: { (Maybe Identifier, [GenItem]) }
GenBlock :: { (Maybe Identifier, [GenItem]) }
: "begin" opt(Tag) GenItems "end" opt(Tag) { (combineTags $2 $5, $3) }
: "begin" opt(Tag) GenItems "end" opt(Tag) { (combineTags $2 $5, $3) }
GenCasesWithDefault :: { ([GenCase], Maybe GenItem) }
: {- empty -} { ([], Nothing) }
| GenCase GenCasesWithDefault { ($1 : fst $2, snd $2) }
| GenCaseDefault GenCases { ($2, Just $1) }
GenCases :: { [GenCase] }
GenCases :: { [GenCase] }
: {- empty -} { [] }
: {- empty -} { [] }
| GenCases GenCase { $1 ++ [$2] }
| GenCases GenCase { $1 ++ [$2] }
...
...
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