Match a quoted string. The quotes have to be present but they
are removed from the result. Quotes inside the string can be
'quoted' using the '\' character eg \"
@param quote style
@param textProvider
@return true if matched
181792
public boolean quotedString(char quote,TextProvider textProvider)        
    {
        clearLastToken(textProvider);
        clearLeadingSpaces(textProvider);
        mark(textProvider);
        if (m_debug)
			debug("testing "+quote,textProvider);

        if (getNextChar(textProvider) != quote)
        {
            reset(textProvider);
            return false;
        }
        char lastChar = 0;
        char c = 0;
        StringBuilder sb = new StringBuilder();
        while (true)
        {
            lastChar = c;
            c = getNextChar(textProvider);
			if (c == 0) {
		        unmark(textProvider);
				return false;
			}
            if (c == quote && lastChar != '\\') break;
            sb.append(c);
        }
        unmark(textProvider);
        String s = sb.toString().trim();
        if (s.length() == 0) return false;
        textProvider.setLastToken(s);
        debug(textProvider);
        return true;
    }
331408
private boolean matchesProvider(final ProviderIdent ident, final ProviderDef pluginDef) {
        return ident.getService().equals(pluginDef.getService()) && ident.getProviderName().equals(pluginDef.getName());
    }
1068831
private static int quote(final StringBuilder target, final String string, final int start) {
        int i = quoteSingle(target, string, start);
        if (i < 0) i = quoteBlock(target, string, start, -i);
        return i;
    }
130580
public final void mQUOTED_String() throws RecognitionException {
		try {
			int _type = QUOTED_String;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:782:4: ( '\\'' ( ( ESCqs )=> ESCqs |~ '\\'' )* '\\'' )
			// hql.g:782:6: '\\'' ( ( ESCqs )=> ESCqs |~ '\\'' )* '\\''
			{
			match('\''); if (state.failed) return;
			// hql.g:782:11: ( ( ESCqs )=> ESCqs |~ '\\'' )*
			loop3:
			while (true) {
				int alt3=3;
				int LA3_0 = input.LA(1);
				if ( (LA3_0=='\'') ) {
					int LA3_1 = input.LA(2);
					if ( (LA3_1=='\'') && (synpred1_hql())) {
						alt3=1;
					}

				}
				else if ( ((LA3_0 >= '\u0000' && LA3_0 <= '&')||(LA3_0 >= '(' && LA3_0 <= '\uFFFF')) ) {
					alt3=2;
				}

				switch (alt3) {
				case 1 :
					// hql.g:782:13: ( ESCqs )=> ESCqs
					{
					mESCqs(); if (state.failed) return;

					}
					break;
				case 2 :
					// hql.g:782:31: ~ '\\''
					{
					if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '&')||(input.LA(1) >= '(' && input.LA(1) <= '\uFFFF') ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

				default :
					break loop3;
				}
			}

			match('\''); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
157436
static boolean matchesProviderDeclaration(final ProviderIdent ident, final Class<?> cls) throws PluginException {
        final Plugin annotation = getPluginMetadata(cls);
        return ident.getFirst().equals(annotation.service()) && ident.getSecond().equals(annotation.name());
    }
59846
private boolean isNextCharacterEscapedQuote(String nextLine, boolean inQuotes, int i) {
    return inQuotes // we are in quotes, therefore there can be escaped
        // quotes in here.
        && nextLine.length() > (i + 1) // there is indeed another
        // character to check.
        && format.isDelimiter(nextLine.charAt(i + 1));
  }
150440
public char match(ISense source, ISense target) throws MatcherLibraryException {
        int Equals = 0;
        int moreGeneral = 0;
        int lessGeneral = 0;
        int Opposite = 0;
        String sSynset = source.getGloss();
        String tSynset = target.getGloss();
        StringTokenizer stSource = new StringTokenizer(sSynset, " ,.\"'()");
        String lemmaS, lemmaT;
        while (stSource.hasMoreTokens()) {
            StringTokenizer stTarget = new StringTokenizer(tSynset, " ,.\"'()");
            lemmaS = stSource.nextToken();
            if (!meaninglessWords.contains(lemmaS))
                while (stTarget.hasMoreTokens()) {
                    lemmaT = stTarget.nextToken();
                    if (!meaninglessWords.contains(lemmaT)) {
                        if (isWordLessGeneral(lemmaS, lemmaT))
                            lessGeneral++;
                        else if (isWordMoreGeneral(lemmaS, lemmaT))
                            moreGeneral++;
                        else if (isWordSynonym(lemmaS, lemmaT))
                            Equals++;
                        else if (isWordOpposite(lemmaS, lemmaT))
                            Opposite++;
                    }
                }
        }
        return getRelationFromInts(lessGeneral, moreGeneral, Equals, Opposite);
    }
1234636
protected boolean isQuoteDelimiter( String character ) {
        String quoteDelimiters = "\"'";
        if (quoteDelimiters.indexOf(character) < 0)
            return false;
        else
            return true;
    }
840145
protected void debug(TextProvider textProvider)
	{
		if (!m_debug) return;
		Throwable t = new Throwable();
		StackTraceElement e[] = t.getStackTrace();
		StackTraceElement ste = e[1];
		String indent = "";
		for (int i=0;i<m_indent;i++)
			indent +="  ";
		log.debug("{}SUCCESS {}:{}",indent,ste.getMethodName(),textProvider.debug());
	}
1217478
protected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i) {
        return inQuotes  // we are in quotes, therefore there can be escaped quotes in here.
                && nextLine.length() > (i + 1)  // there is indeed another character to check.
                && (nextLine.charAt(i + 1) == quotechar || nextLine.charAt(i + 1) == this.escape);
    }
162619
private Token quotedText(char quote) throws ScanException {
        nextChar(); // eat the '"'
        text = new StringBuilder();
        while (c != quote) {
            if (c == '\n') {
                throw new ScanException("Unclosed quoted text, reached end of line.");
            }
            text.append(c);
            nextChar();
        }
        nextChar(); // eat the '"'
        return TEXT;
    }
1197009
private String getRuleName(RulesTextProvider textProvider)
    {
		if (!quotedString('"',textProvider))
		{
			return "R"+(textProvider.incrementRuleCount());
		}
    	return textProvider.getLastToken();
    }
668583
public T match(CharSequence text, boolean matchPrefix)
    {
        if (root == null)
        {
            throw new IllegalStateException("not compiled");
        }
        int length = text.length();
        for (int ii=0;ii<length;ii++)
        {
            switch (match(text.charAt(ii)))
            {
                case Error:
                    return null;
                case Ok:
                    if (matchPrefix)
                    {
                        T uniqueMatch = state.getUniqueMatch();
                        if (uniqueMatch != null)
                        {
                            state = root;
                            return uniqueMatch;
                        }
                    }
                    break;
                case Match:
                    return getMatched();
            }
        }
        return null;
    }
1311335
private static boolean needsQuote(String value) {
        if (null == value)
            return true;
        int len = value.length();
        if (0 == len) {
            return true;
        }
        if ('"' == value.charAt(0)) {
            if ('"' == value.charAt(len - 1)) {
                // already wrapped with quotes
                return false;
            }
            // we now know this has a quote (special char) in it, so return now
            return true;
        }

        for (int i = 0; i < len; i++) {
            char c = value.charAt(i);
            if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {
                return true;
            }
        }
        return false;
    }
1176280
@SuppressWarnings("fallthrough")
    protected DCText quotedString() {
        int pos = bp;
        nextChar();

        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    break;

                case ' ': case '\t':
                    break;

                case '"':
                    nextChar();
                    // trim trailing white-space?
                    return m.at(pos).newTextTree(newString(pos, bp));

                case '@':
                    if (newline)
                        break loop;

            }
            nextChar();
        }
        return null;
    }
1244510
protected void compareText(Text control, Text test,
                               DifferenceListener listener)
        throws DifferenceFoundException {
        compareText((CharacterData) control, (CharacterData) test, listener);
    }
182559
public static String quote(final String value) {
        if (value == null) {
            return null;
        }
        String result = value;
        if (!result.startsWith("\"")) {
            result = "\"" + result;
        }
        if (!result.endsWith("\"")) {
            result = result + "\"";
        }
        return result;
    }