Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
  * Systems and Internet Infrastructure Security Laboratory
  * Author: Damien Octeau
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package edu.psu.cse.siis.coal;
Compiler for COAL model. This class simply serializes COAL models. It should be called with the input directory as the first argument and the destination file as the second argument.
public class ModelCompiler {
  private static Logger logger = LoggerFactory.getLogger(ModelCompiler.class);
  public static void main(String[] argsthrows ParseExceptionIOException {
    compileModel(args[0], args[1]);

Compiles a COAL model.

inputDir The input directory that contains the COAL specification files.
outputPath The path to the output file.
edu.psu.cse.siis.coal.lang.ParseException if something goes wrong with the COAL parsing. if something goes wrong with the file operations.
  private static void compileModel(String inputDirString outputPaththrows ParseException,
      IOException {
    .info("Compiling model from directory " + inputDir + " to " + outputPath);
    File outputFile = new File(outputPath);
    FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
    ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
New to GrepCode? Check out our FAQ X