2020-02-02 08:12:24 +00:00
|
|
|
# Verilog Filelist Parser
|
2020-01-21 16:20:20 +00:00
|
|
|
|
2020-02-02 08:12:24 +00:00
|
|
|
A library in Rust to parse a Verilog Filelist and return
|
2020-02-02 08:33:53 +00:00
|
|
|
a list of files, include directories and defines.
|
|
|
|
|
|
|
|
Environment variables represented with paranthesis or
|
|
|
|
curly braces (i.e. $() or ${}) will be automatically
|
|
|
|
substituted.
|
2020-02-02 08:12:24 +00:00
|
|
|
|
|
|
|
# Example
|
|
|
|
```rust
|
|
|
|
use verilog_filelist_parser;
|
|
|
|
let filelist = verilog_filelist_parser::parse_file("testcase/files.f")
|
|
|
|
.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),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|