src/main/java/org/helm/notation2/parser/groupingsection/GroupingParser.java
@Override
  public void doAction(char cha) throws GroupingSectionException, NotationException {
    /*
     * group section is finished: section was empty: annotation section starts
     */
    if (cha == '$') {
      /* no details */
      if (groupId == "" && _parser.notationContainer.getListOfGroupings().size() == 0) {
        LOG.info("Group section is empty:");
        LOG.info("Transition to annotation section:");
        _parser.setState(new AnnotationsParser(_parser));
      } else {
        throw new GroupingSectionException("Missing details about the group: " + groupId);
      }

    } /* detailed information about the group is starting */ else if (cha == '(') {
      if (_parser.checkGroupId(groupId)) {
        LOG.info("Group ID is read:");
        _parser.notationContainer.addGrouping(new GroupingNotation(groupId));
        _parser.setState(new GroupingDetailedInformationParser(_parser));
      } else {
        LOG.error("Invalid group ID: " + groupId);
        throw new GroupingSectionException("Invalid group Id: " + groupId);
      }
    } /* add characters to the group id */ else {
      groupId += cha;
    }

  }
@Override
  public void doAction(char cha) throws GroupingSectionException, NotationException {
    /*
     * group section is finished: section was empty: annotation section starts
     */
    if (cha == '$') {
      /* no details */
      if (groupId == "" && _parser.notationContainer.getListOfGroupings().size() == 0) {
        LOG.info("Group section is empty:");
        LOG.info("Transition to annotation section:");
        _parser.setState(new AnnotationsParser(_parser));
      } else {
        throw new GroupingSectionException("Missing details about the group: " + groupId);
      }

    } /* detailed information about the group is starting */ else if (cha == '(') {
      if (_parser.checkGroupId(groupId)) {
        LOG.info("Group ID is read:");
        _parser.notationContainer.addGrouping(new GroupingNotation(groupId));
        _parser.setState(new GroupingDetailedInformationParser(_parser));
      } else {
        LOG.error("Invalid group ID: " + groupId);
        throw new GroupingSectionException("Invalid group Id: " + groupId);
      }
    } /* add characters to the group id */ else {
      groupId += cha;
    }

  }
{@inheritDoc}

@throws NotationException if notation is not valid