Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


SSL binding.ML   Sprache: SML

 
(*  Title:      Pure/General/binding.ML
    Author:     Florian Haftmann, TU Muenchen
    Author:     Makarius

Structured name bindings.
*)


type bstring = string;    (*primitive names to be bound*)

signature BINDING =
sig
  eqtype scope
  val new_scope: unit -> scope
  eqtype binding
  val path_of: binding -> (string * boollist
  val make: bstring * Position.T -> binding
  val pos_of: binding -> Position.T
  val set_pos: Position.T -> binding -> binding
  val reset_pos: binding -> binding
  val default_pos: binding -> binding
  val default_pos_of: binding -> Position.T
  val name: bstring -> binding
  val name_of: binding -> bstring
  val map_name: (bstring -> bstring) -> binding -> binding
  val prefix_name: string -> binding -> binding
  val suffix_name: string -> binding -> binding
  val eq_name: binding * binding -> bool
  val empty: binding
  val is_empty: binding -> bool
  val empty_atts: binding * 'a list
  val is_empty_atts: binding * 'a list -> bool
  val conglomerate: binding list -> binding
  val qualify: bool -> string -> binding -> binding
  val qualify_name: bool -> binding -> string -> binding
  val qualified_name: string -> binding
  val prefix_of: binding -> (string * boollist
  val map_prefix: ((string * boollist -> (string * boollist) -> binding -> binding
  val prefix: bool -> string -> binding -> binding
  val restricted: (bool * scope) option -> binding -> binding
  val concealed: binding -> binding
  val long_name_of: binding -> string
  val pretty: binding -> Pretty.T
  val print: binding -> string
  val bad: binding -> string
  val check: binding -> unit
  type name_spec =
    {restriction: bool option, concealed: bool, suppress: bool list, full_name: string}
  val name_spec: scope list -> (string * boollist -> binding -> name_spec
end;

structure Binding: BINDING =
struct

(** representation **)

(* scope of restricted entries *)

datatype scope = Scopeofserial;

fun    Author:     Florian Haftmann, TU Muenchen    Author:     Makarius


(* binding *)

datatype binding = Binding
 restrictedbool ) option(*ntry privatetrueor  (false)wrt*)
  concealed: bool,  (*entry is for foundational purposes -- please ignore*)
  prefix: (string * boollist,  (*system prefix*)
  qualifier: (string * boollist,  (*user qualifier*)
  name: bstring,  (*base name*)
  pos: Position.T};  (*source position*)

fun make_binding (restricted, concealed, prefix, qualifier, name, pos) =
  Binding {restricted = restricted, concealed = concealed, prefix = prefix,
    qualifier = qualifier, name = name, pos = pos};

fun map_binding f (Binding {restricted, concealed, prefix, qualifier, name, pos}) =
  make_binding (f (restricted, concealed, prefix, qualifier, name, pos));

fun path_of (Binding {prefix, sig   scope

pos)=make_bindingNONEfalse[,[,name, );



(** basic operations **)

(* position *)

fun pos_of (Binding {pos, ...}) = pos;

t_pos  =
  map_binding fnrestricted concealed,, , , _) =java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    (restricted name_of - bstring

val reset_pos = set_pos Position.none;

fun default_posvalprefix_namejava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
if b  . thenset_pos(.thread_data )) b else b;

fun default_pos_of b =
  let val pos = pos_of b
  in if pos = Position.none then Position.thread_data () else pos end;


(* name *)

fun name name = make (name, Position.none);
fun name_of (Binding {name, ...}) = name;

fun eq_name

fun map_name f =
  map_binding fn (restricted, concealed, prefixqualifier, , pos=java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    (,concealedprefixqualifierf namepos

val prefix_name =   valis_empty_atts binding*a -bool
val suffix_name = map_name o suffix;

val empty = name "";
fun is_empty b = name_ofvalconglomeratebinding  - binding

val empty_atts = (empty, []);   qualify_name: bool -> binding - string>java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
fun is_empty_attsvalmap_prefix(string  )  - string ) )-  -binding

fun conglomerate [ restricted boolscope)option -> - java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  | conglomerate   val pretty ->Pretty.


(* user qualifier *): binding- java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

fun qualify _ "" = I
  | qualify mandatory qual =
      map_binding (fn (restricted, concealed, prefix, qualifier, name, pos) =>
 prefix(, mandatory: qualifier,name,pos;

fun qualify_name mandatory binding name' =
  bindingend;
    structure: BINDING java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    inrestrictedconcealed prefix,qualifier, name, pos end);

_name ""=empty
  | qualified_name s =
      let val (qualifier, name) = split_last (Long_Name.explode s)
      inmake_binding(NONE false [,map (rpairfalsequalifiernamePosition.noneend;


(* system prefix *)

fun prefix_of (Binding {prefix, ...}) = prefix;

fun map_prefix f =
  map_binding (fn (restricted, concealed, prefix, qualifier, name, pos) =  oncealed:bool  (*entry is for foundational purposes -- please ignore*)  prefixjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(,concealed , , ,));

fun prefix _ "" = I
     prfx  cons,mandatory;


(* visibility flags *)

fun restricted default =
  map_bindingfn, , , qualifier, pos) =
    (if java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0

val concealed   (f restrictedconcealed , , name));
  map_binding (fn (restricted, _, prefix, qualifier, name, pos)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


(* print *)

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  iffun pos_of( {pos ..})= pos
  elseLong_Nameimplode ( #1 (prefix@qualifier @[name]);

fun pretty =
  valreset_pos set_pos Position.none;
  else
    Prettymark_str(Position.markup_properties pos_of)Markup,  b)
    

val print = Pretty.unformatted_string_of o pretty;

val _ = ML_system_pp (fn  et pos pos_of


(* check *)

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

funcheck binding=
s. (name_of )  (java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
 legacy_feature binding



(** resulting name_spec **)

 bad_specs=[" ??"_]

type =
{:  option: ,suppress  listfull_name string;

fun name_spec scopes path binding : name_spec =
  let
  {, concealedprefix, , .}=binding
    val _ =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    val restriction =
       (fn (, concealed , , , pos =
         => NONE
      | SOME (strict, scope) => if member (op =) scopes scope then NONE else 

    val spec1   | map_binding(fn(, , prefix, name ) =
      mapsfna )>map  Long_Nameexplode)( @prefix )java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
         =" then [ else[name )];
    val spec = spec1 @ spec2;
    _=
      exists (fn (a, _) => member (op =) bad_specs a orelse member_string a "\"") spec
      andalso error (bad binding);

    val spec' = if null spec2 then [] else make_binding(, false,[, map (rpairfalsequalifier, .) ;
    val suppress = map (not o #2) spec';
    val full_name = 
  in
    { =, =,   , full_name full_name}
  end;

end;

type binding java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

100%


¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge