Search in sources :

Example 11 with RuntimeObject

use of priv.bajdcc.LALR1.grammar.runtime.RuntimeObject in project jMiniLang by bajdcc.

the class RuntimeMachine method opMap.

@Override
public void opMap() throws RuntimeException {
    int size = current();
    next();
    RuntimeMap map = new RuntimeMap();
    for (int i = 0; i < size; i++) {
        map.put(loadString(), load());
    }
    stack.pushData(new RuntimeObject(map));
}
Also used : RuntimeMap(priv.bajdcc.LALR1.grammar.runtime.data.RuntimeMap)

Example 12 with RuntimeObject

use of priv.bajdcc.LALR1.grammar.runtime.RuntimeObject in project jMiniLang by bajdcc.

the class RuntimeMachine method opArr.

@Override
public void opArr() throws RuntimeException {
    int size = current();
    next();
    RuntimeArray arr = new RuntimeArray();
    for (int i = 0; i < size; i++) {
        arr.add(load());
    }
    stack.pushData(new RuntimeObject(arr));
}
Also used : RuntimeArray(priv.bajdcc.LALR1.grammar.runtime.data.RuntimeArray)

Example 13 with RuntimeObject

use of priv.bajdcc.LALR1.grammar.runtime.RuntimeObject in project jMiniLang by bajdcc.

the class RuntimeMachine method opReloadFunc.

@Override
public void opReloadFunc() throws RuntimeException {
    int idx = loadInt();
    RuntimeFuncObject func = new RuntimeFuncObject(stack.reg.pageId, stack.reg.execId);
    RuntimeObject obj = new RuntimeObject(func);
    obj.setSymbol(currentPage.getData().get(idx));
    stack.storeVariableDirect(idx, obj);
}
Also used : RuntimeFuncObject(priv.bajdcc.LALR1.grammar.runtime.data.RuntimeFuncObject)

Example 14 with RuntimeObject

use of priv.bajdcc.LALR1.grammar.runtime.RuntimeObject in project jMiniLang by bajdcc.

the class RuntimePipeService method stat.

@Override
public RuntimeArray stat() {
    RuntimeArray array = new RuntimeArray();
    array.add(new RuntimeObject(String.format("   %-5s   %-15s   %-15s   %-15s", "Id", "Name", "Queue", "Waiting")));
    mapPipeNames.values().stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()).forEach((value) -> {
        array.add(new RuntimeObject(String.format("   %-5s   %-15s   %-15d   %-15d", String.valueOf(value), arrPipes[value].name, arrPipes[value].queue.size(), arrPipes[value].waiting_pids.size())));
    });
    return array;
}
Also used : RuntimeArray(priv.bajdcc.LALR1.grammar.runtime.data.RuntimeArray) RuntimeObject(priv.bajdcc.LALR1.grammar.runtime.RuntimeObject)

Example 15 with RuntimeObject

use of priv.bajdcc.LALR1.grammar.runtime.RuntimeObject in project jMiniLang by bajdcc.

the class RuntimeShareService method stat.

@Override
public RuntimeArray stat() {
    RuntimeArray array = new RuntimeArray();
    array.add(new RuntimeObject(String.format("   %-15s   %-15s   %-5s   %-5s", "Name", "Type", "Ref", "Locked")));
    mapShares.values().stream().sorted(Comparator.comparing(ShareStruct::getObjType).thenComparing(ShareStruct::getName)).collect(Collectors.toList()).forEach((value) -> {
        array.add(new RuntimeObject(String.format("   %-15s   %-15s   %-5s   %-5s", value.name, value.obj.getType().name(), String.valueOf(value.reference), String.valueOf(value.locked))));
    });
    return array;
}
Also used : RuntimeArray(priv.bajdcc.LALR1.grammar.runtime.data.RuntimeArray) RuntimeObject(priv.bajdcc.LALR1.grammar.runtime.RuntimeObject)

Aggregations

RuntimeArray (priv.bajdcc.LALR1.grammar.runtime.data.RuntimeArray)9 BigInteger (java.math.BigInteger)6 Grammar (priv.bajdcc.LALR1.grammar.Grammar)6 RuntimeException (priv.bajdcc.LALR1.grammar.runtime.RuntimeException)4 RuntimeObject (priv.bajdcc.LALR1.grammar.runtime.RuntimeObject)4 RuntimeFuncObject (priv.bajdcc.LALR1.grammar.runtime.data.RuntimeFuncObject)4 BufferedReader (java.io.BufferedReader)3 List (java.util.List)3 Matcher (java.util.regex.Matcher)3 RuntimeMap (priv.bajdcc.LALR1.grammar.runtime.data.RuntimeMap)3 InputStreamReader (java.io.InputStreamReader)2 URL (java.net.URL)2 URLConnection (java.net.URLConnection)2 Pattern (java.util.regex.Pattern)2 Document (org.dom4j.Document)2 Node (org.dom4j.Node)2 SAXReader (org.dom4j.io.SAXReader)2 RuntimeCodePage (priv.bajdcc.LALR1.grammar.runtime.RuntimeCodePage)2 ModuleNetClient (priv.bajdcc.LALR1.interpret.module.net.ModuleNetClient)2 ModuleNetServer (priv.bajdcc.LALR1.interpret.module.net.ModuleNetServer)2