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
6d79e0b4
Commit
6d79e0b4
authored
Oct 10, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated number literals
parent
149d16d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
src/Language/SystemVerilog/Parser/Lex.x
+20
-13
No files found.
src/Language/SystemVerilog/Parser/Lex.x
View file @
6d79e0b4
...
@@ -43,8 +43,8 @@ import Language.SystemVerilog.Parser.Tokens
...
@@ -43,8 +43,8 @@ import Language.SystemVerilog.Parser.Tokens
-- Numbers
-- Numbers
$
nonZeroDecimalDigit = [1-9]
@
nonZeroDecimalDigit = [1-9]
$
decimalDigit = [0-9]
@
decimalDigit = [0-9]
@xDigit = [xX]
@xDigit = [xX]
@zDigit = [zZ\?]
@zDigit = [zZ\?]
@binaryDigit = @xDigit | @zDigit | [0-1]
@binaryDigit = @xDigit | @zDigit | [0-1]
...
@@ -56,33 +56,40 @@ $decimalDigit = [0-9]
...
@@ -56,33 +56,40 @@ $decimalDigit = [0-9]
@octalBase = "'" [sS]? [oO]
@octalBase = "'" [sS]? [oO]
@hexBase = "'" [sS]? [hH]
@hexBase = "'" [sS]? [hH]
@
binaryValue = @binaryDigit ("_" | @binary
Digit)*
@
nonZeroUnsignedNumber = @nonZeroDecimalDigit ("_" | @decimal
Digit)*
@
octalValue = @octalDigit ("_" | @oct
alDigit)*
@
unsignedNumber = @decimalDigit ("_" | @decim
alDigit)*
@
hexValue = @hexDigit ("_" | @hexDigit
)*
@
binaryValue = @binaryDigit ("_" | @binaryDigit
)*
@octalValue = @octalDigit ("_" | @octalDigit )*
@
unsignedNumber = $decimalDigit ("_" | $decimalDigit
)*
@
hexValue = @hexDigit ("_" | @hexDigit
)*
@exp = [eE]
@sign = [\-\+]
@sign = [\-\+]
@fixedPointNumber = @unsignedNumber "." @unsignedNumber
@fixedPointNumber = @unsignedNumber "." @unsignedNumber
@floatingPointNumber = @unsignedNumber ("." @unsignedNumber)? [eE] @sign? @unsignedNumber
@realNumber
= @fixedPointNumber
| @unsignedNumber ("." @unsignedNumber)? @exp @sign? @unsignedNumber
@size = @
u
nsignedNumber " "?
@size = @
nonZeroU
nsignedNumber " "?
@decimalNumber = @size? @decimalBase " "? @unsignedNumber
@binaryNumber = @size? @binaryBase " "? @binaryValue
@binaryNumber = @size? @binaryBase " "? @binaryValue
@octalNumber = @size? @octalBase " "? @octalValue
@octalNumber = @size? @octalBase " "? @octalValue
@hexNumber = @size? @hexBase " "? @hexValue
@hexNumber = @size? @hexBase " "? @hexValue
@realNumber = @fixedPointNumber | @floatingPointNumber
@unbasedUnsizedLiteral = "'" ( 0 | 1 | x | X | z | Z )
@unbasedUnsizedLiteral = "'" ( 0 | 1 | x | X | z | Z )
@
n
umber
@
decimalN
umber
= @unsignedNumber
= @unsignedNumber
| @decimalNumber
| @size? @decimalBase " "? @unsignedNumber
| @size? @decimalBase " "? @xDigit "_"*
| @size? @decimalBase " "? @zDigit "_"*
@integralNumber
= @decimalNumber
| @octalNumber
| @octalNumber
| @binaryNumber
| @binaryNumber
| @hexNumber
| @hexNumber
| @unbasedUnsizedLiteral
| @unbasedUnsizedLiteral
@number
= @integralNumber
| @realNumber
| @realNumber
-- Strings
-- Strings
...
...
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