Example #1
0
  @Override
  public void ambiguousString(
      final AmbiDexterConfig cfg, final SymbolString s, final NonTerminal n, String messagePrefix) {
    try {
      final IConstructor sym =
          (IConstructor)
              reader.read(
                  VF,
                  RascalValueFactory.uptr,
                  RascalValueFactory.Symbol,
                  new StringReader(n.prettyPrint()));
      final String ascii = toascci(s);
      final String module = getModuleName(cfg.filename);
      final String project = getProjectName(cfg.filename);

      addItem(sym, ascii, module, project, null);
    } catch (FactTypeUseException e) {
      Activator.getInstance().logException("failed to register ambiguity", e);
    } catch (IOException e) {
      Activator.getInstance().logException("failed to register ambiguity", e);
    }
  }
Example #2
0
    @Override
    protected IStatus run(IProgressMonitor monitor) {
      this.monitor = monitor;

      // main.printGrammar();
      try {
        main.checkGrammar();
      } catch (OutOfMemoryError e) {
        Activator.log("out of memory while checking grammar for ambiguity", e);
        main = null; // help the GC in this case
        System.gc();
      }

      monitor.done();
      this.monitor = null;
      return Status.OK_STATUS;
    }