public static IndicatorAttribute fromNode(Node node) {

    if (!node.hasTag("indicator:")) {
      throw new CoreException("Expected 'indicator:' not '" + node.tag + "'.");
    }

    Indicator indicator = Indicator.valueOf(node.getSingleLeaf());
    int[] tokens = getTokens(node);
    return tokens != null
        ? new IndicatorAttribute(indicator, tokens[0], tokens[1])
        : new IndicatorAttribute(indicator);
  }
Example #2
0
  public static Sequence fromNode(Node node) {

    if (!node.hasTag("sequence:")) {
      throw new CoreException("Expected 'sequence:' not '" + node.tag + "'.");
    }

    Sequence sequence = new Sequence();
    for (Node child : node.children) {
      sequence.events.add(Event.fromNode(child));
    }
    return sequence;
  }