All pastes #267969 Raw Edit

Someone

public java v1 · immutable
·published 2006-12-05 06:36 UTC
rendered paste body
void SystemFunction_WRITELN(Program prg) {            MemoryManagement fncMemory = new MemoryManagement(prg.memory);            Variable resultVariable = new ReferenceVariable("result",                    Type.UNKNOWN);            ReferenceVariable[] params = new ReferenceVariable[1];            params[0] = new ReferenceVariable("_str", PrimitiveType.STRING);            for (Variable param : params) {                if (fncMemory.variableExists(param, false)) {                    log("[iSCAR] identifierRedeclared " + param.getIdentifier());                } else {                    fncMemory.addVariable(param);                }            }            Function function = new SystemFunction_WRITELN("writeln", null,                    fncMemory, params, resultVariable);            if (prg.memory.functionExists(function, true)) {                log("[iSCAR]  Already declared " + function);            }            prg.memory.addFunction(function);        }                class SystemFunction_WRITELN extends Function {            /** Creates a new instance of SystemFunction_SIN */            public SystemFunction_WRITELN(String name, Statement body,                    MemoryManagement memory, ReferenceVariable[] params,                    Variable result) {                super(name, body, memory, params, result);            }            public void exec() throws InterpreterRuntimeException {                log(paramAt(0).stringValue());            }        }                void IBOTFunction_MOVEMOUSE(Program prg) {            MemoryManagement fncMemory = new MemoryManagement(prg.memory);            Variable resultVariable = new ReferenceVariable("result",                    Type.UNKNOWN);            ReferenceVariable[] params = new ReferenceVariable[2];            params[0] = new ReferenceVariable("_str", PrimitiveType.INTEGER);            params[1] = new ReferenceVariable("_str2", PrimitiveType.INTEGER);            for (Variable param : params) {                if (fncMemory.variableExists(param, false)) {                    log("[iSCAR] identifierRedeclared " + param.getIdentifier());                } else {                    fncMemory.addVariable(param);                }            }            Function function = new IBOTFunction_MOVEMOUSE("movemouse", null,                    fncMemory, params, resultVariable);            if (prg.memory.functionExists(function, true)) {                log("[iSCAR]  Already declared " + function);            }            prg.memory.addFunction(function);        }                class IBOTFunction_MOVEMOUSE extends Function {            /** Creates a new instance of SystemFunction_SIN */            public IBOTFunction_MOVEMOUSE(String name, Statement body,                    MemoryManagement memory, ReferenceVariable[] params,                    Variable result) {                super(name, body, memory, params, result);            }            public void exec() throws InterpreterRuntimeException {                try {                    mouseMove(paramAt(0).intValue(), paramAt(1).intValue());                } catch (InterruptedException exception) {                    throw new InterpreterRuntimeException("from IBOT.mouseMove()");                }            }        }