aboutsummaryrefslogtreecommitdiff
path: root/src/main/antlr4/FIRRTL.g4
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/antlr4/FIRRTL.g4')
-rw-r--r--src/main/antlr4/FIRRTL.g411
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/antlr4/FIRRTL.g4 b/src/main/antlr4/FIRRTL.g4
index d40c6560..10a87c9e 100644
--- a/src/main/antlr4/FIRRTL.g4
+++ b/src/main/antlr4/FIRRTL.g4
@@ -29,7 +29,16 @@ import firrtl.LexerHelper;
// Does there have to be at least one module?
circuit
- : 'circuit' id ':' info? INDENT module* DEDENT EOF
+ : version? NEWLINE* 'circuit' id ':' info? INDENT module* DEDENT EOF
+ ;
+
+version
+ : 'FIRRTL' 'version' semver NEWLINE
+ ;
+
+// Due to lexer problems, something like 1.1.0 is lexed as DoubleLit '.' UnsignedInt
+semver
+ : DoubleLit '.' UnsignedInt
;
module