aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/mt-tool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/mt-tool.rs')
-rw-r--r--src/bin/mt-tool.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bin/mt-tool.rs b/src/bin/mt-tool.rs
index 4d66339..8aac6ca 100644
--- a/src/bin/mt-tool.rs
+++ b/src/bin/mt-tool.rs
@@ -4,6 +4,7 @@ extern crate rustc_serialize;
extern crate getopts;
use modelthing::modelica_parser;
+use modelthing::transpile_scheme::TranspileScheme;
use getopts::Options;
use std::env;
use std::io::Read;
@@ -81,6 +82,14 @@ fn main() {
let cmd = matches.free[0].clone();
match cmd.as_str() {
"parse" => { parse_modelica_files(matches.free[1..].iter().map(|x| x.to_string()).collect()); },
+ "transpile" => {
+ if matches.free.len() != 2 {
+ println!("Expected a single path to load");
+ exit(-1);
+ }
+ let me = modelthing::load_model_entry(Path::new(&matches.free[1])).unwrap();
+ println!("{}", me.ast.repr_scheme().unwrap());
+ },
"list" => {
// XXX: search path?
for m in modelthing::search_models(Path::new("examples")) {