Skip to main content

Crate scarf_python

Crate scarf_python 

Source
Expand description

Python bindings for the scarf SystemVerilog tools

When crossing the FFI boundary, Rust’s borrow checker can no longer provide lifetime guarantees; as such, many data structures must be cloned, and have associated From/Into implementations for their reference-based Rust counterparts. This quickly becomes the dominant factor in runtime; if speed/space usage becomes a concern, native Rust applications should be considered instead.

Modules§

scarf_python
The top-level Python module

Structs§

Bytes
A wrapper around std::ops::Range<usize>
Define
A wrapper around scarf_parser::preprocessor::Define
Node
A wrapper around scarf_syntax::Node, providing a single CST node
NodeIterator
An iterator over Nodes
Report
A wrapper around scarf_parser::report::Report
Span
A wrapper around scarf_syntax::Span, providing a location in the source code where a Node was found
SpannedToken
A source file Token with an associated Span
VerboseError
A wrapper around scarf_parser::VerboseError

Enums§

Expectation
An expectation instead of what was found
ParserResult
The result of parsing a SystemVerilog source
PreprocessorError
A wrapper around scarf_parser::PreprocessorError
PreprocessorResult
The result of preprocessing a SystemVerilog source
ReportKind
The type of report being generated, used for coloring output
Token
A wrapper around scarf_parser::Token

Functions§

define_empty
Create a Define for a name with no replacement text
define_text
Create a Define for a name with some replacement text
lex
Separate a source file into syntactic tokens
parse
Parse the token stream into a concrete syntax tree
parse_from_preprocess
Same as parse, but operates on the output of preprocess
preprocess
Preprocess a token stream, elaborating compiler directives
preprocess_from_lex
Same as preprocess, but operates on the output of lex