Package org.zkoss.zuss.metainfo

Examples of org.zkoss.zuss.metainfo.BlockDefinition


    case IF:
      nextAndCheck(ctx, '(', false);
      expr = new Expression(_in.getLine());
      parseExpression(ctx, expr, '{');
      newBlock(ctx,
        new BlockDefinition(
          new IfDefinition(ctx.block.owner, kw.getLine()), expr, expr.getLine()));
      return;
    case ELSE:
      idef = getLastIf(ctx, kw);
      nextAndCheck(ctx, '{', false);
      newBlock(ctx, new BlockDefinition(idef, null, kw.getLine()));
      return;
    case ELIF:
      idef = getLastIf(ctx, kw);
      expr = new Expression(_in.getLine());
      parseExpression(ctx, expr, '{');
      newBlock(ctx, new BlockDefinition(idef, expr, kw.getLine()));
      return;
    }
    throw error(kw+" not supported yet", kw);
  }
View Full Code Here


          write(Classes.toString(o));
        }
      }
    } else if (node instanceof IfDefinition) { //in a rule
      for (NodeInfo child: node.getChildren()) {
        final BlockDefinition block = (BlockDefinition)child;
        final Expression expr = block.getCondition();
        if (expr == null || isTrue(scope, expr)) {
          for (NodeInfo subnd: block.getChildren()) {
            empty = outRuleInner(scope, thisSels, subnd, head, end, empty);
          }
          break; //done
        }
      }
View Full Code Here

    } else if (node instanceof MixinDefinition) {
      final MixinDefinition fd = (MixinDefinition)node;
      scope.setVariable(fd.getName(), fd);
    } else if (node instanceof IfDefinition) { //assume not in a rule (outerSel shall be null)
      for (NodeInfo child: node.getChildren()) {
        final BlockDefinition block = (BlockDefinition)child;
        final Expression expr = block.getCondition();
        if (expr == null || isTrue(scope, expr)) {
          outChildren(scope, outerSels, block);
          break; //done
        }
      }
View Full Code Here

TOP

Related Classes of org.zkoss.zuss.metainfo.BlockDefinition

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.