sv-filelist-parser/README.md

28 lines
718 B
Markdown
Raw Normal View History

2022-05-12 16:19:15 +00:00
# SystemVerilog Filelist Parser
2020-01-21 16:20:20 +00:00
A Rust library to parse a SystemVerilog Filelist and return lists of files,
include directories, and preprocessor macro definitions.
2020-02-02 08:33:53 +00:00
Environment variables, optionally enclosed in parenthesis or curly braces
(e.g. `$FOO`, `$(FOO)` or `${FOO}`), will be substituted.
2020-02-02 08:12:24 +00:00
2022-05-12 16:19:15 +00:00
## Example
2020-02-02 08:12:24 +00:00
```rust
2022-05-12 16:19:15 +00:00
use sv_filelist_parser;
let filelist = sv_filelist_parser::parse_file("testcase/files.f")
2020-02-02 08:12:24 +00:00
.expect("Cannot read filelist");
for file in filelist.files {
println!("{:?}", file);
}
for incdir in filelist.incdirs {
println!("{:?}", incdir);
}
for (d, t) in filelist.defines {
match t {
None => println!("{:?}", d),
Some(te) => println!("{:?}={:?}", d, te),
};
}
```