Skip to content

Commit

Permalink
Change name from Sc2CsVisitor to ModelBuilder and module from cs_buil…
Browse files Browse the repository at this point in the history
…der to builder

Signed-off-by: Enrico Ghiorzi <[email protected]>
  • Loading branch information
EnricoGhiorzi committed May 30, 2024
1 parent 80113c6 commit 328fbf4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct EventBuilder {
}

#[derive(Debug)]
pub struct Sc2CsVisitor {
pub struct ModelBuilder {
cs: ChannelSystemBuilder,
// Represent OMG types
scan_types: HashMap<String, Type>,
Expand All @@ -55,7 +55,7 @@ pub struct Sc2CsVisitor {
parameters: HashMap<(PgId, PgId, usize, String), Channel>,
}

impl Sc2CsVisitor {
impl ModelBuilder {
pub fn visit(parser: Parser) -> anyhow::Result<CsModel> {
// Add base types
// FIXME: Is there a better way? Const object?
Expand All @@ -65,7 +65,7 @@ impl Sc2CsVisitor {
(String::from("URI"), Type::Integer),
];

let mut model = Sc2CsVisitor {
let mut model = ModelBuilder {
cs: ChannelSystemBuilder::new(),
scan_types: HashMap::from_iter(base_types),
enums: HashMap::new(),
Expand Down
4 changes: 2 additions & 2 deletions scan_fmt_xml/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Parser and model builder for SCAN's XML specification format.

mod cs_builder;
mod builder;
mod parser;

pub use cs_builder::Sc2CsVisitor;
pub use builder::ModelBuilder;
pub use parser::Parser;
2 changes: 1 addition & 1 deletion scan_fmt_xml/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn param_triangle() -> anyhow::Result<()> {

fn test(file: PathBuf) -> anyhow::Result<()> {
let parser = Parser::parse(file)?;
let mut model = Sc2CsVisitor::visit(parser)?;
let mut model = ModelBuilder::visit(parser)?;
let mut steps = 0;
assert!(model.cs.possible_transitions().count() > 0);
while let Some((pg_id, act, loc)) = model
Expand Down

0 comments on commit 328fbf4

Please sign in to comment.