Expand description
A SystemVerilog preprocessor and parser
scarf-parser provides capabilities for transformting a SystemVerilog
source file into a CST compliant with IEEE 1800-2023, with an
emphasis on informative error messages. It can be used as the
front-end for other tools looking to interpret SystemVerilog designs.
§Features
lossless: Equivalent to thelosslessfeature forscarf_syntax. Produces a CST with room for non-trivia nodes, but does not actually parse any from provided sourcesparse_lossless: Extendslosslessto parse non-trivia tokens. Due to their arbitrary position in source files, this adds a measurable performance decrease, and should only be used if newlines/comments are needed.
Re-exports§
pub use lexer::LexedSource;pub use lexer::Token;pub use lexer::lex;pub use parser::parse;pub use preprocessor::*;
Modules§
- lexer
- Lexing a source file into semantic tokens
- parser
- preprocessor
- Preprocessing a token stream, elaborating compiler directives
Structs§
- Report
- A type representing a diagnostic that is ready to be written to output.
- Source
- A type representing a single source that may be referred to by
Spans. - Span
- A representation of a unique location in a source file
- Spanned
String - A string and its associated
Spanin the source files - Spanned
Token - A token and its location in the source code
- Verbose
Error - A verbose error message describing the error location, what was found, and what was expected instead
Enums§
- Expectation
- Something the parser expected to find instead of what was found, in the case of an error