Examples of ParseNode


Examples of org.jboss.byteman.rule.grammar.ParseNode

    private List<Method> accessibleMethods;

    private Rule(RuleScript ruleScript, ClassLoader loader, HelperManager helperManager)
            throws ParseException, TypeException, CompileException
    {
        ParseNode ruleTree;

        this.ruleScript = ruleScript;
        this.helperClass = null;
        this.loader = loader;

        typeGroup = new TypeGroup(loader);
        bindings = new Bindings();
        checked = false;
        triggerClass = null;
        triggerMethod = null;
        triggerDescriptor = null;
        triggerAccess = 0;
        returnType = null;
        accessibleFields =  null;
        accessibleMethods = null;
        // this is only set when the rule is created via a real installed transformer
        this.helperManager =  helperManager;
        ECAGrammarParser parser = null;
        try {
            String file = getFile();
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(ruleScript.getRuleText()));
            lexer.setStartLine(getLine());
            lexer.setFile(file);
            parser = new ECAGrammarParser(lexer);
            parser.setFile(file);
            Symbol parse = (debugParse ? parser.debug_parse() : parser.parse());
            if (parser.getErrorCount() != 0) {
                String message = "rule " + ruleScript.getName();
                message += parser.getErrors();
                throw new ParseException(message);
            }
            ruleTree = (ParseNode) parse.value;
        } catch (ParseException pe) {
            throw pe;
        } catch (Throwable th) {
            String message = "rule " + ruleScript.getName();
            if (parser != null && parser.getErrorCount() != 0) {
                message += parser.getErrors();
            }
            message += "\n" + th.getMessage();
            throw new ParseException(message);
        }

        ParseNode eventTree = (ParseNode)ruleTree.getChild(0);
        ParseNode conditionTree = (ParseNode)ruleTree.getChild(1);
        ParseNode actionTree = (ParseNode)ruleTree.getChild(2);

        event = Event.create(this, eventTree);
        condition = Condition.create(this, conditionTree);
        action = Action.create(this, actionTree);
        key = null;
View Full Code Here

Examples of org.jnode.driver.system.acpi.aml.ParseNode

    }

    public void parse(NameSpace origin, ParseNode root) {
        if (root == null)
            return;
        ParseNode op = root.geChild();

        while (op != null) {
            switch (op.getType()) {
                case Aml.AML_SCOPE:
                    Scope scope = new Scope(origin, op.getNameToString());
                    parse(scope, op);
                    break;
                case Aml.AML_DEVICE:
                    Device device = new Device(origin, op.getNameToString());
                    Object address = op.findNameValue("_HID");
                    if (address instanceof String)
                        device.addAddress("_HID", (String) address);
                    else if (address instanceof Integer)
                        device.addAddress("_HID", PnP.eisaIdToString(((Integer) address).intValue()));
                    parse(device, op);
                    break;
            }
            op = op.getNext();
        }
    }
View Full Code Here

Examples of org.jnode.driver.system.acpi.aml.ParseNode

            root.dump(out);
        }
    }

    public void dumpBattery(PrintWriter out) {
        ParseNode battery;
        battery = sdt.getParsedAml().findName(new NameString("BAT0"),
            Aml.AML_DEVICE);
        if (battery != null) {
            out.println(battery.toString());
        }
        battery = sdt.getParsedAml().findName(new NameString("BAT1"),
            Aml.AML_DEVICE);
        if (battery != null) {
            out.println(battery.toString());
        }
    }
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.