Пример #1
0
 public Env<AttrContext> attribute(Env<AttrContext> env) {
   if (env.toplevel.sourcefile instanceof CeylonFileObject || isBootstrap) {
     try {
       sourceLanguage.push(Language.CEYLON);
       return super.attribute(env);
     } finally {
       sourceLanguage.pop();
     }
   }
   return super.attribute(env);
 }
Пример #2
0
 @Override
 public void complete(ClassSymbol c) throws CompletionFailure {
   try {
     sourceLanguage.push(Language.JAVA);
     super.complete(c);
   } catch (RunTwiceException e) {
     hadRunTwiceException = true;
     throw new CompletionFailure(c, e.getLocalizedMessage());
   } finally {
     sourceLanguage.pop();
   }
 }
Пример #3
0
 protected void flow(Env<AttrContext> env, Queue<Env<AttrContext>> results) {
   if (env.toplevel.sourcefile instanceof CeylonFileObject) {
     try {
       sourceLanguage.push(Language.CEYLON);
       super.flow(env, results);
       return;
     } finally {
       sourceLanguage.pop();
     }
   }
   super.flow(env, results);
 }
Пример #4
0
 protected void desugar(
     final Env<AttrContext> env, Queue<Pair<Env<AttrContext>, JCClassDecl>> results) {
   if (env.toplevel.sourcefile instanceof CeylonFileObject) {
     try {
       sourceLanguage.push(Language.CEYLON);
       super.desugar(env, results);
       return;
     } finally {
       sourceLanguage.pop();
     }
   }
   super.desugar(env, results);
 }
Пример #5
0
 @Override
 protected JavaFileObject genCode(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
   if (env.toplevel.sourcefile instanceof CeylonFileObject) {
     try {
       sourceLanguage.push(Language.CEYLON);
       // call our own genCode
       return genCodeUnlessError(env, cdef);
     } finally {
       sourceLanguage.pop();
     }
   }
   return super.genCode(env, cdef);
 }
Пример #6
0
 public LanguageCompiler(Context context) {
   super(context);
   ceylonContext = getCeylonContextInstance(context);
   vfs = ceylonContext.getVfs();
   compilerDelegate = getCompilerDelegate(context);
   phasedUnits = getPhasedUnitsInstance(context);
   try {
     gen = CeylonTransformer.getInstance(context);
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
   modelLoader = CeylonModelLoader.instance(context);
   ceylonEnter = CeylonEnter.instance(context);
   options = Options.instance(context);
   isBootstrap = options.get(Option.BOOTSTRAPCEYLON) != null;
   timer = Timer.instance(context);
   sourceLanguage = SourceLanguage.instance(context);
   boolean isProgressPrinted =
       options.get(Option.CEYLONPROGRESS) != null && StatusPrinter.canPrint();
   if (isProgressPrinted) {
     sp = getStatusPrinterInstance(context);
     if (taskListener == null) {
       taskListener.add(new StatusPrinterTaskListener(sp));
     }
   }
 }