Examples of KeywordParserFactory


Examples of org.rythmengine.internal.parser.build_in.KeywordParserFactory

    private List<IParserFactory> freeParsers = new ArrayList<IParserFactory>();

    @Override
    public void registerParserFactory(IParserFactory parser) {
        if (parser instanceof KeywordParserFactory) {
            KeywordParserFactory kp = (KeywordParserFactory) parser;
            IKeyword kw = kp.keyword();
            if (kw.isRegexp()) keywords2.put(kw.toString(), kp);
            else keywords.put(kw.toString(), kp);
        } else {
            if (!freeParsers.contains(parser)) freeParsers.add(parser);
        }
View Full Code Here

Examples of org.rythmengine.internal.parser.build_in.KeywordParserFactory

            }
        }
    }

    public IParser createBuildInParser(String keyword, IContext context) {
        KeywordParserFactory f = keywords.get(keyword.toLowerCase());
        if (null == f) {
            for (String r : keywords2.keySet()) {
                if (keyword.matches(r)) {
                    f = keywords2.get(r);
                    break;
                }
            }
        }
        return null == f ? null : f.create(context);
    }
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.