Examples of PrintStatement


Examples of anvil.script.statements.PrintStatement

  Statement stmt;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case PRINT:
      t = jj_consume_token(PRINT);
      list = PrintValueList(null);
      stmt = new PrintStatement(flowPeek(), toLocation(t), list, false);
      break;
    case HOOK:
      t = jj_consume_token(HOOK);
      list = PrintValueList(null);
      stmt = new PrintStatement(flowPeek(), toLocation(t), list, false);
      break;
    case PRINTLN:
      t = jj_consume_token(PRINTLN);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MODULE:
      case SYMBOL:
      case BEGIN:
      case DOT:
      case STAR:
      case IMPORT:
      case STRING_LITERAL:
      case RANGE:
      case FUNCTION:
      case OPEN:
      case SUPER:
      case STATIC:
      case CLASS:
      case VAR:
      case ET:
      case NEGATION:
      case PLUS:
      case MINUS:
      case MINUSMINUS:
      case PLUSPLUS:
      case COPYOF:
      case CLONEOF:
      case TYPEOF:
      case SIZEOF:
      case CLASSOF:
      case BOOLEAN:
      case INT:
      case FLOAT:
      case STRING:
      case DEFINED:
      case UNDEFINED:
      case NULL:
      case OPEN_BRACKET:
      case CARET:
      case DELETE:
      case BEGIN_LIST:
      case NEW:
      case THIS:
      case INTEGER_LITERAL:
      case FLOATING_POINT_LITERAL:
      case INF:
      case FALSE:
      case TRUE:
      case PATTERN:
        list = PrintValueList(null);
        break;
      default:
        jj_la1[59] = jj_gen;
        ;
      }
      if (list == null) {
        list = new Expression[0];
      }
      stmt = new PrintStatement(flowPeek(), toLocation(t), list, true);
      break;
    case PRINTBR:
      t = jj_consume_token(PRINTBR);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MODULE:
      case SYMBOL:
      case BEGIN:
      case DOT:
      case STAR:
      case IMPORT:
      case STRING_LITERAL:
      case RANGE:
      case FUNCTION:
      case OPEN:
      case SUPER:
      case STATIC:
      case CLASS:
      case VAR:
      case ET:
      case NEGATION:
      case PLUS:
      case MINUS:
      case MINUSMINUS:
      case PLUSPLUS:
      case COPYOF:
      case CLONEOF:
      case TYPEOF:
      case SIZEOF:
      case CLASSOF:
      case BOOLEAN:
      case INT:
      case FLOAT:
      case STRING:
      case DEFINED:
      case UNDEFINED:
      case NULL:
      case OPEN_BRACKET:
      case CARET:
      case DELETE:
      case BEGIN_LIST:
      case NEW:
      case THIS:
      case INTEGER_LITERAL:
      case FLOATING_POINT_LITERAL:
      case INF:
      case FALSE:
      case TRUE:
      case PATTERN:
        list = PrintValueList(new Expression(new ConstantNode("<br>\n"), null));
        break;
      default:
        jj_la1[60] = jj_gen;
        ;
      }
      if (list == null) {
        list = new Expression[0];
      }
      stmt = new PrintStatement(flowPeek(), toLocation(t), list, false);
      break;
    default:
      jj_la1[61] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
View Full Code Here

Examples of com.dubture.twig.core.parser.ast.node.PrintStatement

          return CUP$TwigAstParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 7: // var ::= TWIG_VAR_OPEN inner_statement_list TWIG_VAR_CLOSE
            {
              PrintStatement RESULT = null;
    int startleft = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-2)).left;
    int startright = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-2)).right;
    Object start = (Object)((java_cup.runtime.Symbol) CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-2)).value;
    int innerleft = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-1)).left;
    int innerright = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-1)).right;
    List inner = (List)((java_cup.runtime.Symbol) CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-1)).value;
    int endleft = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).left;
    int endright = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right;
    Object end = (Object)((java_cup.runtime.Symbol) CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).value;
   
              PrintStatement stmt = new PrintStatement(startleft, endright, inner);
              RESULT = stmt;
           
              CUP$TwigAstParser$result = new java_cup.runtime.Symbol(3/*var*/, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right, RESULT);
            }
          return CUP$TwigAstParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 6: // top_statement ::= block
            {
              Statement RESULT = null;
    int bleft = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).left;
    int bright = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right;
    BlockStatement b = (BlockStatement)((java_cup.runtime.Symbol) CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).value;
   
              RESULT = b;
           
              CUP$TwigAstParser$result = new java_cup.runtime.Symbol(5/*top_statement*/, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right, RESULT);
            }
          return CUP$TwigAstParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 5: // top_statement ::= var
            {
              Statement RESULT = null;
    int vleft = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).left;
    int vright = ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right;
    PrintStatement v = (PrintStatement)((java_cup.runtime.Symbol) CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).value;
   
              RESULT = v;
           
              CUP$TwigAstParser$result = new java_cup.runtime.Symbol(5/*top_statement*/, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$TwigAstParser$stack.elementAt(CUP$TwigAstParser$top-0)).right, RESULT);
            }
View Full Code Here

Examples of org.lilystudio.smarty4j.statement.PrintStatement

  }

  @Test
  public void testNullExpression() throws Exception {
    ObjectExpression node = new NullExpression();
    Assert.assertEquals(merge(new PrintStatement(new TranslateString(
        new TranslateCheck(node)))), "false");
    Assert.assertEquals(merge(new PrintStatement(new TranslateString(
        new TranslateInteger(node)))), "0");
    Assert.assertEquals(merge(new PrintStatement(new TranslateString(
        new TranslateDouble(node)))), "0.0");
    Assert.assertEquals(merge(new PrintStatement(new TranslateString(
        new TranslateString(node)))), "null");
    Assert.assertEquals(merge(new PrintStatement(node)), "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.