aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/Parser.scala
AgeCommit message (Collapse)Author
2022-09-13Make the Parser handle errors more gracefully (#2549)Jack Koenig
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.
2022-08-26FIRRTL version support (#2543)Zachary Yedidia
* 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
2021-12-01Use ANTLR Listener to save memory during parsingJack Koenig
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.
2020-09-16Change to Apache 2.0 License (#1901)Chick Markley
2020-08-14All of src/ formatted with scalafmtchick
2020-04-10Support infoMode for Strings (#782)edwardcwang
* 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>
2020-03-07Add firrtl-json serializers (#1430)Adam Izraelevitz
* Add firrtl-json serializers * Added support for ports, info. Added docs and tests
2019-11-29Remove scala-logging fully in favor of our own loggerJack Koenig
There was some vestigial logging that conflicts with the homebrewed logger used by most of the codebase
2019-08-19Refactor exceptions to remove stack trace from user errors (#1157)Jack Koenig
2019-02-25Fix almost all Scaladoc warningsSchuyler Eldridge
This fixes all Scaladoc warnings except for those trying to link to Java. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-06-15Improve Parser and Visitor (#819)Jack Koenig
* 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
2018-03-21Add SyntaxErrorsException as a type of ParserException (#770)Jack Koenig
Also make ParserException extend FIRRTLException to better report parsing errors to the user
2017-03-06Added more stylized debugging styleAdam Izraelevitz
2016-11-04Cleanup license at top of every file (#364)Jack Koenig
Replace with more sensible comment to see LICENSE rather than including the whole license in every file
2016-08-12Fix calculation of runtime for ANTLR Parser (#229)Jack Koenig
2016-08-09provide parser for naive string (#227)Donggyu
2016-07-21Indentation support for the ANTLR parser (as discussed in #192) (#194)Kamyar Mohajerani
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
2016-06-10API Cleanup - ASTJack
trait AST -> abstract class FirrtlNode Move all IR to new package ir Add import of firrtl.ir._
2016-05-12Implement File Infojackkoenig
2016-04-29Cleanup Parser comments and imports - No functional changesjackkoenig
2016-04-29Add timing to Parserjackkoenig
2016-04-26Added flag to parser to turn off using source locators. This allows for ↵Adam Izraelevitz
easier testing, because we don't the source locator information to say a test fails
2016-03-15Revamp string literal handlingjackkoenig
2016-02-09Added license to FIRRTL filesazidar
2016-02-09Adding ScalaTest for unit testing of Scala FIRRTL. Added a few basic tests ↵Jack
for the Parser. Added custom Parser exceptions for better error reporting and checking. Fixed bug in grammar not allowing most keywords as Ids
2016-01-16Added some commentsazidar
2015-12-06Working on generating SimTop, need to figure out how to split the top-level ↵jackkoenig
IO between the sim modules.
2015-12-04Everything is broken, need Translator to work on files without a circuit, ↵jackkoenig
need to parse queue module text in midas/Utils.scala, need to create (src, dst) -> Module mapping in midas/Fame.scala
2015-10-02Merged in Scala implementation of FIRRTL IR, parser, and serialization (ie. ↵Jack
AST -> String). Uses ANTLRv4 to generate concrete syntax parser