示例#1
0
  private SVDBClassDecl parse_class(String content, String name) throws SVParseException {
    SVDBScopeItem scope = new SVDBScopeItem();
    SVParser parser = new SVParser();
    parser.init(new StringInputStream(content), name);

    parser.parsers().classParser().parse(scope, 0);

    return (SVDBClassDecl) scope.getChildren().iterator().next();
  }
示例#2
0
  private SVDBTask parse_tf(SVParserConfig config, String content, String name)
      throws SVParseException {
    SVDBScopeItem scope = new SVDBScopeItem();
    SVParser parser = new SVParser();
    parser.init(new StringInputStream(content), name);

    if (config != null) {
      parser.setConfig(config);
    }

    parser.parsers().taskFuncParser().parse(scope, -1, 0);

    return (SVDBTask) scope.getChildren().iterator().next();
  }