Package apigen.adt.api

Examples of apigen.adt.api.Factory


    params.setFolding(false);
    return params;
  }

  public static void generateAPI(CGenerationParameters params, ADT adt) {
    Factory factory = Factory.getInstance(SingletonFactory.getInstance());
    APIGenerator apigen = new APIGenerator(params, adt);
    apigen.run();
    new CDictionaryGenerator(adt, params, factory.getPureFactory(), apigen
        .getAFunRegister()).run();
    try {
      PrintStream out = new PrintStream(new FileOutputStream(params
          .getOutputDirectory()
          + File.separatorChar + "apigen.env"));
View Full Code Here


  public static ADT readADT(GenerationParameters params) {
    Iterator<String> iter = params.getInputFiles().iterator();
    String fileName = "";
    try {
      Factory factory = Factory.getInstance(SingletonFactory
          .getInstance());
      Modules all = factory.makeModules();
      // Entries all = factory.makeEntries();
      while (iter.hasNext()) {
        fileName = iter.next();
        FileInputStream fis = new FileInputStream(fileName);
        try {
          all = all.concat(factory.ModulesFromFile(fis));
        } catch (IllegalArgumentException ex) {
          fis.close();
          if (params.getApiName() == null) {
            throw new IllegalArgumentException(
                "No API name specified");
          }
          fis = new FileInputStream(fileName);

          all = factory.makeModules(factory.makeModule_Modulentry(
              factory.makeModuleName_Name(""), factory
                  .makeImports(), factory.makeSorts(),
              factory.EntriesFromFile(fis)));

        }
      }
      return ADT.initialize(all);
    } catch (FileNotFoundException e) {
View Full Code Here

TOP

Related Classes of apigen.adt.api.Factory

Copyright © 2018 www.massapicom. 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.