Examples of ParserBase


Examples of org.rythmengine.internal.parser.ParserBase

        return "^(\\n?[ \\t\\x0B\\f]*%s%s((?@())))";
    }

    @Override
    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            @Override
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) {
                    raiseParseException("Error parsing @get call. Correct usage: @get(\"myVal\")");
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    protected String patternStr() {
        return R;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) {
                    raiseParseException("Error parsing @include statement. Correct usage: @include(\"foo.bar, a.b.c, ...\")");
                }
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    public Keyword keyword() {
        return Keyword.RAW;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Matcher m = ptn(dialect()).matcher(remain());
                if (!m.matches()) return null;
                final String matched = m.group(1);
                if (matched.startsWith("\n") || matched.endsWith("\n")) {
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    public Keyword keyword() {
        return Keyword.LOCALE;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) return null;
                final String matched = r.stringMatched();
                if (matched.startsWith("\n") || matched.endsWith("\n")) {
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    protected String patternStr() {
        return R;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (r.search(remain())) {
                    final String matched = r.stringMatched();
                    step(matched.length());
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    public Keyword keyword() {
        return Keyword.DEBUG;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) {
                    raiseParseException("error parsing @debug, correct usage: @debug(\"msg\", args...)");
                }
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    public Keyword keyword() {
        return Keyword.TAG;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) {
                    raiseParseException("Error parsing @def, correct usage: @def tagName([arguments...])");
                }
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

    public Keyword keyword() {
        return Keyword.MACRO;
    }

    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                Regex r = reg(dialect());
                if (!r.search(remain())) {
                    raiseParseException("bad @macro statement. Correct usage: @macro(macro-name){...}");
                }
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

        return "^((?@\"\")|(?@''))(\\s*,\\s*(.*))?";
    }
   
    @Override
    public IParser create(final IContext ctx) {
        return new ParserBase(ctx) {
            public Token go() {
                String remain = remain();
                Regex r = reg(dialect());
                if (!r.search(remain)) {
                    raiseParseException("Error parsing @i18n statement. Correct usage: @i18n(\"key\", ...)");
View Full Code Here

Examples of org.rythmengine.internal.parser.ParserBase

*/
public class InvokeMacroParser extends CaretParserFactoryBase {

    @Override
    public IParser create(IContext ctx) {
        return new ParserBase(ctx) {

            @Override
            public Token go() {
                Regex r = new Regex(String.format(patternStr(), dialect().a()));
                if (!r.search(remain())) return null;
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.