Package wyvern.stdlib

Source Code of wyvern.stdlib.Compiler

package wyvern.stdlib;

import edu.umn.cs.melt.copper.runtime.logging.CopperParserException;
import wyvern.tools.parsing.Wyvern;
import wyvern.tools.typedAST.interfaces.TypedAST;
import wyvern.tools.types.Type;

import java.io.IOException;
import java.io.StringReader;
import java.util.List;
import java.util.Optional;

public class Compiler {
  public static TypedAST compileSources(String filename, List<String> sources) {
    try {
      TypedAST ast = (TypedAST) new Wyvern().parse(new StringReader(sources.get(0)), "test input");
      ast.typecheck(Globals.getStandardEnv(), Optional.<Type>empty());
      return ast;
    } catch (IOException | CopperParserException e) {
      throw new RuntimeException(e);
    }
  }
}
TOP

Related Classes of wyvern.stdlib.Compiler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.