From 4c3b4f4dc10c380a101df75cb561e3f79f1a6abe Mon Sep 17 00:00:00 2001 From: jackkoenig Date: Fri, 23 Sep 2016 13:44:57 -0700 Subject: Add RawString ExtModule parameter support While unsafe, this supports Verilog parameter types. Tests now require Verilator 3.884+ to pass. --- src/main/antlr4/FIRRTL.g4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/antlr4') diff --git a/src/main/antlr4/FIRRTL.g4 b/src/main/antlr4/FIRRTL.g4 index f4d9d3f8..70716c94 100644 --- a/src/main/antlr4/FIRRTL.g4 +++ b/src/main/antlr4/FIRRTL.g4 @@ -97,6 +97,7 @@ parameter : 'parameter' id '=' IntLit NEWLINE | 'parameter' id '=' StringLit NEWLINE | 'parameter' id '=' DoubleLit NEWLINE + | 'parameter' id '=' RawString NEWLINE ; moduleBlock @@ -321,7 +322,16 @@ HexDigit ; StringLit - : '"' ('\\"'|.)*? '"' + : '"' UnquotedString? '"' + ; + +RawString + : '\'' UnquotedString? '\'' + ; + +fragment +UnquotedString + : ('\\"'|~[\r\n])+? ; FileInfo -- cgit v1.2.3