Package org.jboss.byteman.rule.grammar

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


                String typeName = typeTree.getText();
                return getTypeGroup().create(typeName);
            }
            case ARRAY:
            {
                ParseNode child0 = (ParseNode)typeTree.getChild(0);
                Type baseType = getBindingType(child0);
                if (baseType != null) {
                    return getTypeGroup().createArray(baseType);
                } else {
                    return null;
View Full Code Here


        String fullText = "BIND NOTHING IF TRUE DO \n" + text;
        try {
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(text));
            ECAGrammarParser parser = new ECAGrammarParser(lexer);
            Symbol parse = parser.parse();
            ParseNode parseTree = (ParseNode)parse.value;
            ParseNode actionTree = (ParseNode)parseTree.getChild(3);
            Action action = new Action(rule, actionTree);
            return action;
        } catch (Exception e) {
            throw new ParseException("org.jboss.byteman.rule.Action : error parsing action\n" + text);
        }
View Full Code Here

        String fullText = "BIND NOTHING IF TRUE DO \n" + text;
        try {
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(text));
            ECAGrammarParser parser = new ECAGrammarParser(lexer);
            Symbol parse = parser.parse();
            ParseNode parseTree = (ParseNode)parse.value;
            ParseNode actionTree = (ParseNode)parseTree.getChild(3);
            Action action = new Action(rule, actionTree);
            return action;
        } catch (Exception e) {
            throw new ParseException("org.jboss.byteman.rule.Action : error parsing action\n" + text);
        }
View Full Code Here

        String fulltext = "BIND NOTHING IF \n" + text + "\n DO NOTHING";
        try {
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(text));
            ECAGrammarParser parser = new ECAGrammarParser(lexer);
            Symbol condition_parse = parser.parse();
            ParseNode conditionTree = (ParseNode) condition_parse.value;
            Condition condition = new Condition(rule, conditionTree);
            return condition;
        } catch (Exception e) {
            throw new ParseException("org.jboss.byteman.rule.Condition : error parsing condition\n" + text, e);
        }
View Full Code Here

        String fullText = "BIND\n" + text + "\nIF TRUE DO NOTHING";
        try {
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(fullText));
            ECAGrammarParser parser = new ECAGrammarParser(lexer);
            Symbol event_parse = parser.parse();
            ParseNode eventTree = (ParseNode)event_parse.value;
            Event event = new Event(rule, eventTree);
            return event;
        } catch (Exception e) {
            throw new ParseException("org.jboss.byteman.rule.Event : error parsing event\n" + text, e);
        }
View Full Code Here

                int tag = eventTree.getTag();
                switch (tag) {
                    case COMMA:
                    {
                        // update before we risk an exception
                        ParseNode child0 = (ParseNode)eventTree.getChild(0);
                        eventTree = (ParseNode)eventTree.getChild(1);
                        addBinding(bindings, child0);
                    }
                    break;
                    case ASSIGN:
                    {
                        // update before we risk an exception
                        ParseNode saveTree = eventTree;
                        eventTree = null;
                        addBinding(bindings, saveTree);
                    }
                    break;
                    default:
View Full Code Here

        if (tag != ASSIGN) {
            String message = "Event.createBindings : unexpected token Type in binding " + tag + " for token " + bindingTree.getText() + bindingTree.getPos();
            throw new TypeException(message);
        }

        ParseNode varTree = (ParseNode)bindingTree.getChild(0);
        ParseNode exprTree = (ParseNode)bindingTree.getChild(1);
        Binding binding;

        binding = createBinding(varTree);

        // don't allow current binding to be used when parsing the expression
View Full Code Here

            {
                return new Binding(rule, varTree.getText());
            }
            case COLON:
            {
                ParseNode child0 = (ParseNode)varTree.getChild(0);
                ParseNode child1 = (ParseNode)varTree.getChild(1);
                if (child0.getTag() != IDENTIFIER) {
                    throw new TypeException("Event.createBindings : unexpected token type in variable declaration" + child0.getTag() + " for token " + child0.getText() + child0.getPos());
                } else if (child1.getTag() != IDENTIFIER && child1.getTag() != ARRAY) {
                    throw new TypeException("Event.createBindings : unexpected token Type in variable type declaration" + child1.getTag()  + " for token " + child1.getText() + child1.getPos());
                }
                Type type = getBindingType(child1);
                if (type == null) {
                    throw new TypeException("Event.createBindings : incompatible type in declaration of variable " + child1.getText() + child1.getPos());
                }
                return new Binding(rule, child0.getText(), type);
            }
            default:
            {
View Full Code Here

                String typeName = typeTree.getText();
                return getTypeGroup().create(typeName);
            }
            case ARRAY:
            {
                ParseNode child0 = (ParseNode)typeTree.getChild(0);
                Type baseType = getBindingType(child0);
                if (baseType != null) {
                    return getTypeGroup().createArray(baseType);
                } else {
                    return null;
View Full Code Here

        String fullText = "BIND\n" + text + "\nIF TRUE DO NOTHING";
        try {
            ECATokenLexer lexer = new ECATokenLexer(new StringReader(fullText));
            ECAGrammarParser parser = new ECAGrammarParser(lexer);
            Symbol event_parse = parser.parse();
            ParseNode eventTree = (ParseNode)event_parse.value;
            Event event = new Event(rule, eventTree);
            return event;
        } catch (Exception e) {
            throw new ParseException("org.jboss.byteman.rule.Event : error parsing event\n" + text, e);
        }
View Full Code Here

TOP

Related Classes of org.jboss.byteman.rule.grammar.ParseNode

Copyright © 2018 www.massapicom. 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.