Esempio n. 1
0
 public static void AssignV(Variable lhs, IP6 rhs)
 {
     if (!lhs.islist) {
         lhs.Store(rhs);
     } else {
         Frame n = lhs.Fetch().InvokeMethod(Kernel.GetInferiorRoot(),
                 "LISTSTORE",
                 new Variable[2] { lhs, Kernel.NewROScalar(rhs) }, null);
         Kernel.RunInferior(n);
     }
 }
Esempio n. 2
0
 public IPWindow()
 {
     InitializeComponent();
     IP1.SetBinding(TextBlock.TextProperty, new Binding("IP1")
     {
         Source = DataList
     });
     IP2.SetBinding(TextBlock.TextProperty, new Binding("Port1")
     {
         Source = DataList
     });
     IP3.SetBinding(TextBlock.TextProperty, new Binding("IP2")
     {
         Source = DataList
     });
     IP4.SetBinding(TextBlock.TextProperty, new Binding("Port2")
     {
         Source = DataList
     });
     IP5.SetBinding(TextBlock.TextProperty, new Binding("IP3")
     {
         Source = DataList
     });
     IP6.SetBinding(TextBlock.TextProperty, new Binding("Port3")
     {
         Source = DataList
     });
     IP7.SetBinding(TextBlock.TextProperty, new Binding("IP4")
     {
         Source = DataList
     });
     IP8.SetBinding(TextBlock.TextProperty, new Binding("Port4")
     {
         Source = DataList
     });
 }
Esempio n. 3
0
    public void UnpackCaps(IP6 into)
    {
        List<VarDeque> posr = new List<VarDeque>();
        Dictionary<string,VarDeque> namr = new Dictionary<string,VarDeque>();
        CapInfo it = captures;

        while (it != null) {
            foreach (string name in it.names) {
                int nami;
                VarDeque t;
                if (int.TryParse(name, out nami) && nami >= 0) {
                    while(posr.Count <= nami) posr.Add(new VarDeque());
                    t = posr[nami];
                } else {
                    if (!namr.TryGetValue(name, out t))
                        namr[name] = t = new VarDeque();
                }
                t.Unshift(it.cap);
            }
            it = it.prev;
        }

        VarHash nam = new VarHash();
        Variable[] pos = new Variable[posr.Count];

        foreach (KeyValuePair<string, VarDeque> kv in namr)
            nam[kv.Key] = FixupList(kv.Value);
        for (int i = 0; i < pos.Length; i++)
            pos[i] = FixupList(posr[i]);

        into.SetSlot("positionals", pos);
        into.SetSlot("named", nam);
    }
Esempio n. 4
0
 public void SynPushCapture(string name, IP6 obj)
 {
     captures = new CapInfo(captures, new string[] { name },
             Kernel.NewROScalar(obj));
 }
Esempio n. 5
0
 public Cursor FreshClass(IP6 from)
 {
     return new Cursor(global, from.mo, nstate, xact, pos, null);
 }
Esempio n. 6
0
 public Cursor(IP6 proto, string text)
     : this(new GState(text), proto.mo, null, null, 0, null)
 {
 }
Esempio n. 7
0
    public static IP6[] RunProtoregex(Frame fromf, IP6 cursor, string name)
    {
        DynMetaObject kl = cursor.mo;

        DynObject[] candidates = ResolveProtoregex(kl.GetLexerCache(), name);
        Lexer l = GetProtoregexLexer(kl, name);
        Cursor c = (Cursor)cursor;
        int[] brnum = l.Run(c.global.orig_s, c.pos);

        IP6[] ret = new IP6[brnum.Length];
        for (int i = 0; i < brnum.Length; i++)
            ret[i] = candidates[brnum[i]];

        return ret;
    }