Package org.rythmengine.internal.parser

Examples of org.rythmengine.internal.parser.BlockCodeToken


                            ctx.getCodeBuilder().addBuilder(new Token.StringToken(blank, ctx));
                        }
                    }
                }
                step(matched.length());
                return new BlockCodeToken("__ctx.pushEscape(org.rythmengine.utils.Escape.RAW);", ctx()) {
                    @Override
                    public void openBlock() {
                    }

                    @Override
View Full Code Here


                    s1 = "\n\t}\n} else {\n";
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
                processFollowingOpenBraceAndLineBreak(false);
                BlockCodeToken tk = new BlockCodeToken(s1, ctx) {
                    @Override
                    public String closeBlock() {
                        return "}}";
                    }
                };
View Full Code Here

                String code = s;
                Locale locale = (Locale)ctx.getEngine().eval(String.format("org.rythmengine.utils.Eval.locale(%s)", code));
                ctx.pushLocale(locale);
                s = String.format("__ctx.pushLocale(org.rythmengine.utils.Eval.locale(%s));", s);
               
                return new BlockCodeToken(s, ctx()) {
                    @Override
                    public void openBlock() {
                    }

                    @Override
View Full Code Here

                        if (blank.length() > 0) {
                            ctx.getCodeBuilder().addBuilder(new Token.StringToken(blank, ctx));
                        }
                    }
                }
                return new BlockCodeToken("", ctx()) {
                    @Override
                    public void openBlock() {
                        ctx().getCodeBuilder().addBuilder(new Token("", ctx()) {
                            @Override
                            protected void output() {
View Full Code Here

                        }
                    }
                }
                String s = r.stringMatched(1);
                final String macro = S.stripBraceAndQuotation(s);
                return new BlockCodeToken("", ctx()) {
                    @Override
                    public void openBlock() {
                        ctx().getCodeBuilder().pushMacro(macro);
                    }
View Full Code Here

                        if (blank.length() > 0) {
                            ctx.getCodeBuilder().addBuilder(new Token.StringToken(blank, ctx));
                        }
                    }
                }
                return new BlockCodeToken("", ctx()) {
                    @Override
                    public void openBlock() {
                        ctx().getCodeBuilder().addBuilder(new Token("", ctx()) {
                            @Override
                            protected void output() {
View Full Code Here

                if (Arrays.binarySearch(Escape.stringValues(), s) < 0) {
                    raiseParseException("Error parsing @escape statement. Escape parameter expected to be one of %s, found: %s", Arrays.asList(Escape.stringValues()), s);
                }
                */
                s = String.format("__ctx.pushEscape(org.rythmengine.utils.Escape.valueOfIngoreCase(this, %s));", s);
                return new BlockCodeToken(s, ctx()) {
                    @Override
                    public void openBlock() {
                    }

                    @Override
View Full Code Here

                        s1 = "int " + varCursor + " = 0;//line: " + lineNo + "\nfor ";
                        s2 = s2 + "if (" + varCursor + "++ > 0) {p(" + separator + ");} //line: " + lineNo + "\n\t";
                    }
                    // get rid of the "{" if it is followed
                    processFollowingOpenBraceAndLineBreak(leadingLB);
                    return new BlockCodeToken(s1 + s + s2, ctx()) {
                        @Override
                        public void openBlock() {
                            ctx().pushBreak(IContext.Break.BREAK);
                            ctx().pushContinue(IContext.Continue.CONTINUE);
                        }
View Full Code Here

TOP

Related Classes of org.rythmengine.internal.parser.BlockCodeToken

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.