public SimpleNode(TsurgeonParser p, int i) : this(i) { parser = p; }
/// <summary> /// Parses an operation string into a {@link TsurgeonPattern}. Throws an {@link TsurgeonParseException} if /// the operation string is ill-formed. /// /// Example of use: /// TsurgeonPattern p = Tsurgeon.parseOperation("prune ed"); /// </summary> /// <param name="operationString">The operation to perform, as a text string</param> /// <returns>the operation pattern</returns> public static TsurgeonPattern ParseOperation(string operationString) { try { var parser = new TsurgeonParser(new StringReader(operationString + "\n")); return parser.Root(); } catch (ParseException e) { throw new TsurgeonParseException("Error parsing Tsurgeon expression: " + operationString, e); } catch (TokenMgrException e) { throw new TsurgeonParseException("Error parsing Tsurgeon expression: " + operationString, e); } }