package com.github.parboiled1.grappa.vcard;

import com.github.parboiled1.grappa.event.EventBusParser;
import org.parboiled.Rule;
import org.parboiled.support.StringBuilderVar;

public class VcardValueParser
    extends EventBusParser<String>
{
    private final StringBuilderVar sb = new StringBuilderVar();


    public Rule value(final boolean quotedPrintable)
    {
        final Rule special = quotedPrintable ? qpNextLine()
            : nonQpNextLine();
        final Rule normal
            = oneOrMore(testNot(special), ANY, sb.append(match()));

        sb.clear();
        return
            join(normal).using(special).min(1);
    }

    /*
     * Quoted printable
     */
    protected Rule qpNextLine()
    {
        return sequence("=0D=0A", crlf());
    }

    /*
     * Not quoted printable
     */
    protected Rule nonQpNextLine()
    {
        return sequence(crlf(), "  ");
    }
}

@@ -415,47 +415,83 @@
  ? q
-pNextLine()%0A            : nonQpNextLine
+uotedPrintableLineSeparator()%0A            : nonQuotedPrintableLineSeparator
 ();%0A
@@ -734,25 +734,43 @@
 d Rule q
-pNextLine
+uotedPrintableLineSeparator
 ()%0A    %7B
@@ -812,32 +812,489 @@
 crlf());%0A    %7D%0A%0A
+    protected Rule quotedPrintableEOI()%0A    %7B%0A        return string(%22=%5Cr%5Cn%22);%0A    %7D%0A%0A    protected Rule quotedPrintableContent()%0A    %7B%0A        return sequence(oneOrMore(noneOf(%22=%22)), sb.append(match()));%0A    %7D%0A%0A    protected Rule quotedPrintableFull()%0A    %7B%0A        return sequence(%0A            join(quotedPrintableContent())%0A                .using(quotedPrintableLineSeparator())%0A                .min(1),%0A            quotedPrintableEOI()%0A        );%0A    %7D%0A%0A
     /*%0A     * No
@@ -1347,17 +1347,35 @@
 nonQ
-pNextLine
+uotedPrintableLineSeparator
 ()%0A 
@@ -1415,12 +1415,418 @@
 (), 
-%22  %22
+oneOrMore(wsp()));%0A    %7D%0A%0A    protected Rule nonQuotedPrintableContent()%0A    %7B%0A        return sequence(oneOrMore(noneOf(%22%5Cr%22), ANY), sb.append(match()));%0A    %7D%0A%0A    protected Rule nonQuotedPrintableFull()%0A    %7B%0A        return join(nonQuotedPrintableContent())%0A            .using(nonQuotedPrintableLineSeparator())%0A            .min(1);%0A    %7D%0A%0A    public String getValue()%0A    %7B%0A        return sb.get().toString(
 );%0A 

Modify VcardValueParser again...