Rule normalTemplate() { return Sequence( content(), push(new JtwigRootDocument(pop())), EOI ); }
Rule normalTemplate() { return Sequence( content(), push(new JtwigRootDocument(pop())), EOI ); }
Rule output() { return Sequence( symbol(OPEN_OUTPUT), mandatory( Sequence( expressionParser.expression(), push(new Output(expressionParser.pop())), basicParser.symbol(JtwigSymbol.CLOSE_OUTPUT) ), new ParseException("Wrong output syntax") ) ); }
Rule output() { return Sequence( symbol(OPEN_OUTPUT), mandatory( Sequence( expressionParser.expression(), push(new Output(expressionParser.pop())), basicParser.symbol(JtwigSymbol.CLOSE_OUTPUT) ), new ParseException("Wrong output syntax") ) ); }
Rule include() { return Sequence( openCode(), keyword(INCLUDE), mandatory( Sequence( basicParser.stringLiteral(), basicParser.spacing(), push(new Include(basicParser.pop())), closeCode() ), new ParseException("Wrong include syntax") ) ); }
Rule include() { return Sequence( openCode(), keyword(INCLUDE), mandatory( Sequence( basicParser.stringLiteral(), basicParser.spacing(), push(new Include(basicParser.pop())), closeCode() ), new ParseException("Wrong include syntax") ) ); }
Rule set() { return Sequence( openCode(), keyword(SET), mandatory( Sequence( expressionParser.variable(), push(new SetVariable((Variable) expressionParser.pop())), symbol(ATTR), expressionParser.expression(), ((SetVariable) peek(1)).setAssignment(expressionParser.pop()), closeCode() ), new ParseException("Wrong set syntax") ) ); }
Rule text (Rule until) { return Sequence( push(new Text()), OneOrMore( FirstOf( Sequence( basicParser.escape(), ((Text) peek()).append(match()) ), Sequence( TestNot( until ), ANY, ((Text) peek()).append(match()) ) ) ).suppressSubnodes() ); }
Rule text (Rule until) { return Sequence( push(new Text()), OneOrMore( FirstOf( Sequence( basicParser.escape(), ((Text) peek()).append(match()) ), Sequence( TestNot( until ), ANY, ((Text) peek()).append(match()) ) ) ).suppressSubnodes() ); }
Rule set() { return Sequence( openCode(), keyword(SET), mandatory( Sequence( expressionParser.variable(), push(new SetVariable((Variable) expressionParser.pop())), symbol(ATTR), expressionParser.expression(), ((SetVariable) peek(1)).setAssignment(expressionParser.pop()), closeCode() ), new ParseException("Wrong set syntax") ) ); }
Rule text() { return Sequence( push(new Text()), OneOrMore( FirstOf( Sequence("{#", ZeroOrMore(TestNot("#}"), ANY), "#}"), Sequence( basicParser.escape(), ((Text) peek()).append(match()) ), Sequence( TestNot( FirstOf( basicParser.symbol(OPEN_OUTPUT), basicParser.symbol(OPEN_CODE) ) ), ANY, ((Text) peek()).append(match()) ) ) ).suppressSubnodes() ); }
Rule text() { return Sequence( push(new Text()), OneOrMore( FirstOf( Sequence("{#", ZeroOrMore(TestNot("#}"), ANY), "#}"), Sequence( basicParser.escape(), ((Text) peek()).append(match()) ), Sequence( TestNot( FirstOf( basicParser.symbol(OPEN_OUTPUT), basicParser.symbol(OPEN_CODE) ) ), ANY, ((Text) peek()).append(match()) ) ) ).suppressSubnodes() ); }
Rule block() { return Sequence( openCode(), keyword(BLOCK), mandatory( Sequence( expressionParser.variable(), push(new Block(((Variable) expressionParser.pop()).getIdentifier())), closeCode(), content(), (((Block) peek(1)).setContent(pop())), openCode(), keyword(ENDBLOCK), Optional( expressionParser.variable(), assertEqual( ((Block)peek()).getName(), ((Variable) expressionParser.pop()).getIdentifier() ) ), closeCode() ), new ParseException("Wrong block syntax") ) ); }
Rule block() { return Sequence( openCode(), keyword(BLOCK), mandatory( Sequence( expressionParser.variable(), push(new Block(((Variable) expressionParser.pop()).getIdentifier())), closeCode(), content(), (((Block) peek(1)).setContent(pop())), openCode(), keyword(ENDBLOCK), Optional( expressionParser.variable(), assertEqual( ((Block)peek()).getName(), ((Variable) expressionParser.pop()).getIdentifier() ) ), closeCode() ), new ParseException("Wrong block syntax") ) ); }
expressionParser.expression(), closeCode(), push(new IfExpression(expressionParser.pop())), content(), ((IfExpression) peek(1)).setContent(pop()),
expressionParser.expression(), closeCode(), push(new IfExpression(expressionParser.pop())), content(), ((IfExpression) peek(1)).setContent(pop()),
Rule content() { return Sequence( push(new JtwigContent()), ZeroOrMore( FirstOf(
Rule content() { return Sequence( push(new JtwigContent()), ZeroOrMore( FirstOf(