Ejemplo n.º 1
0
  public static void main(String args[]) {
    try {
      if (args.length != 1) {
        System.out.println("usage: jlustre2excel <input>");
        System.exit(-1);
      }
      String filename = args[0];

      Program program = Main.parseLustre(filename);
      StaticAnalyzer.check(program, Level.WARNING);

      Node main = Translate.translate(program);
      String outFilename = filename + ".xls";
      Node2Excel.convert(main, outFilename);
      System.out.println("Wrote " + outFilename);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(-1);
    }
  }
Ejemplo n.º 2
0
  public static Map<String, Type> get(Program program) {
    Map<String, Type> mapping = new HashMap<String, Type>();

    Node node = Translate.translate(program);

    ExprTypeVisitor exprTypeVisitor = new ExprTypeVisitor(program);
    exprTypeVisitor.setNodeContext(node);

    for (VarDecl var : node.inputs) {
      mapping.put(var.id, exprTypeVisitor.resolveType(var.type));
    }

    for (VarDecl var : node.locals) {
      mapping.put(var.id, exprTypeVisitor.resolveType(var.type));
    }

    for (VarDecl var : node.outputs) {
      mapping.put(var.id, exprTypeVisitor.resolveType(var.type));
    }
    return mapping;
  }