Examples of TMaybe


Examples of frege.prelude.PreludeBase.TMaybe

   
    public boolean visit(TGlobal g, TSymbolT sym) {
      pushSubItem(new SymbolItem(g, sym));
      if (TSymbolT.M.has$env(sym))  visit(g, TSymbolT.M.env(sym), false);
      else if (TSymbolT.M.has$expr(sym)) {
        final TMaybe mbex       = TSymbolT.M.expr(sym);
        final TMaybe.DJust just = mbex._Just();
        if (just != null) {
          Lambda lam = Delayed.<Lambda>forced(just.mem1);
          final TExprT expr = Delayed.<TExprT>forced(State.evalState(lam, g));
          visit(g, expr);
        }
View Full Code Here

Examples of frege.prelude.PreludeBase.TMaybe

      }
      if (tid != TTokenID.VARID
          && tid != TTokenID.CONID
          && tid != TTokenID.QUALIFIER
          && (tid < TTokenID.LOP0 ||  tid > TTokenID.SOMEOP)) return null;
      final TMaybe mb = TGlobal.resolved(g, tok);
      final DJust just = mb._Just();
      if (just == null) return null;
      final TEither lr = Delayed.<TEither>forced( just.mem1 );
      final DRight right = lr._Right();
      if (right != null) {
        // this is a QName
        TQName q = Delayed.<TQName>forced( right.mem1 );
        final TMaybe mbsym = TGlobal.findit(g, q).<TMaybe>forced();
        final DJust  jsym  = mbsym._Just();
        if (jsym == nullreturn null;   // not found?
        final TSymbolT sym = Delayed.<TSymbolT>forced( jsym.mem1 );
        System.err.println("getLinkTarget: " + QNames.IShow_QName.show(q));
        return new Symbol(g, sym);
      }
      final DLeft  left = lr._Left();
      if (left != null) {
        // this is a namespace
        String ns = TToken.value(tok);
        final TTree tree = TGlobal.namespaces(g);
        final TMaybe mbpack = TTree.M.lookupS(tree, ns);
        final DJust jpack = mbpack._Just();
        if (jpack == null) return null;
        String pack = Delayed.<java.lang.String>forced(jpack.mem1);
        return new Namespace(g, ns, pack);
      }
    }
View Full Code Here

Examples of frege.prelude.PreludeBase.TMaybe

    iconAttribute    = new TextAttribute(dconColor,  null, italic ? SWT.ITALIC : SWT.NORMAL);
  }
 
  public TextAttribute getKind(FregeParseController controller, TToken tok, TextAttribute normalAttribute) {
    TGlobal g = controller.getCurrentAst();
    final TMaybe mb = TGlobal.resolved(g, tok);
    final TMaybe.DJust just = mb._Just();
    if (just == null) return normalAttribute;
    final TEither et = Delayed.<TEither>forced( just.mem1 );
    final DRight right = et._Right();
    if (right == null) return nsAttribute;      // since it is Left ()
    final TQName qname = Delayed.<TQName>forced( right.mem1 );
View Full Code Here
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.