private Layout parseLayout(TokenStream tokens){
  Doc.GroupKind kind=Doc.GroupKind.VERTICAL;
  Doc separator=Doc.BREAK;
  int nest=0;
  if (tokens.has("vertical")) {
    tokens.next();
    kind=Doc.GroupKind.VERTICAL;
  }
 else   if (tokens.has("horizontal")) {
    tokens.next();
    kind=Doc.GroupKind.HORIZONTAL;
  }
 else   if (tokens.has("auto")) {
    tokens.next();
    kind=Doc.GroupKind.AUTO;
  }
 else   if (tokens.has("fill")) {
    tokens.next();
    kind=Doc.GroupKind.FILL;
  }
  if (tokens.has(INT_LITERAL)) {
    nest=Integer.parseInt(tokens.next());
  }
  if (tokens.has(JOIN_SEPARATOR)) {
    tokens.next();
    Elem expr=parseExpr(tokens);
    if (expr != null) {
      separator=evalParsingTime(expr);
    }
  }
  return Layout.create(separator,kind,nest);
}

private Layout parseLayout ( TokenStream tokens ) { Doc . GroupKind kind = Doc . GroupKind . VERTICAL ; Doc separator = Doc . BREAK ; int nest = 0 ; if ( tokens . has ( "vertical" ) ) { tokens . next ( ) ; kind = Doc . GroupKind . VERTICAL ; } else if ( tokens . has ( "horizontal" ) ) { tokens . next ( ) ; kind = Doc . GroupKind . HORIZONTAL ; } else if ( tokens . has ( "auto" ) ) { tokens . next ( ) ; kind = Doc . GroupKind . AUTO ; } else if ( tokens . has ( "fill" ) ) { tokens . next ( ) ; kind = Doc . GroupKind . FILL ; } if ( tokens . has ( INT_LITERAL ) ) { nest = Integer . parseInt ( tokens . next ( ) ) ; } if ( tokens . has ( JOIN_SEPARATOR ) ) { tokens . next ( ) ; Elem expr = parseExpr ( tokens ) ; if ( expr != null ) { separator = evalParsingTime ( expr ) ; } } return Layout . create ( separator , kind , nest ) ; }
parse a layout specification .
