| Age | Commit message (Collapse) | Author |
|
Ever since introducing the Listener, the firrtl Parser now can hit
errors in the code converting from concrete syntax to abstract syntax
that may be due to syntax errors. These errors are essentially broken
assumptions about the structure of the parsed code because there is an
error. These errors are reported before the standard ANTLR syntax errors
are aggregated and reported, and thus could result in less than elegant
error messages (eg. NullPointerException). Now, the Parser will mask off
such errors in the event of standard syntax errors caught by the
ANTLR-generated parser.
This commit also cleans up some ParserSpec tests slightly to make the
ScalaTest style more canonical.
|
|
* Parse version and hardcode emitted version
* Throw error if version is too high
* Parse version even if rest is invalid
* Change pattern match to if statement
* Improve version grammar
* Update tests
* Remove outdated comment
* Simplify grammar and use version class
* Simplify and add no version test
* Fix for conflicting lexer rule
|
|
The ANTLR-generated concrete syntax tree (CST) takes up much more memory
than the parsed .fir file. By using a Listener, we can construct the
FIRRTL AST live with CST construction and null out the CST as we consume
pieces of it. Not only does this improve performance, it drastically
reduces max memory use for the parser.
|
|
|
|
|
|
* Support infoMode for Strings
It seemed like an API hole that I couldn't use infoMode with a string but had to manually create an iterator first.
* Fix build error
Co-authored-by: Jim Lawson <ucbjrl@berkeley.edu>
|
|
* Add firrtl-json serializers
* Added support for ports, info. Added docs and tests
|
|
There was some vestigial logging that conflicts with the homebrewed
logger used by most of the codebase
|
|
|
|
This fixes all Scaladoc warnings except for those trying to link to
Java.
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
|
|
* Update Parser to use ANTLR CharStreams
This removes some unnecessary object creation in String reading and
manipulation
* Remove two unnecessary traversals from Block construction in Visitor
|
|
Also make ParserException extend FIRRTLException to better report parsing
errors to the user
|
|
|
|
Replace with more sensible comment to see LICENSE rather than including the
whole license in every file
|
|
|
|
|
|
Indentation support for the ANTLR parser
- some clean-up of the parser code (TODO: file input could be improved, more clean-up)
- get rid of Translator and specify all syntactic rules in antlr4 grammer
- support for else-when shorthand in the grammar
- rename Begin to Block which makes more sense
|
|
trait AST -> abstract class FirrtlNode
Move all IR to new package ir
Add import of firrtl.ir._
|
|
|
|
|
|
|
|
easier testing, because we don't the source locator information to say a test fails
|
|
|
|
|
|
for the Parser. Added custom Parser exceptions for better error reporting and checking. Fixed bug in grammar not allowing most keywords as Ids
|
|
|
|
IO between the sim modules.
|
|
need to parse queue module text in midas/Utils.scala, need to create (src, dst) -> Module mapping in midas/Fame.scala
|
|
AST -> String). Uses ANTLRv4 to generate concrete syntax parser
|