@Override public StringSentence shallowCopy() { return new StringSentence(this); }
parser.beginColumn = offsetLine(str, sentenceBeginLine, sentenceBeginColumn, offset + i); try { StringSentence ss = new StringSentence(content.substring(0, i), startLine, startColumn, type, label); parser.AttributesEOF(ss); return ss; return new StringSentence(content, startLine, startColumn, type, label);
/** Parses a given string that was read from 'source' as a list of attributes. Note that the source position in the returned result is relative to the String. */ public static Attributes parseAttributes(String string, Source source) throws ParseException { Outer parser = new Outer(new StringReader(string)); parser.source = source; parser.module = null; parser.items = new ArrayList<DefinitionItem>(); StringSentence ss = new StringSentence("", 0, 0, "", ""); try { parser.AttributesBodyEOF(ss); } catch (TokenMgrError e) { throw new ParseException(e.getMessage()); } return ss.getAttributes(); }