james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wiederkehr <markus.wiederk...@gmail.com>
Subject JavaCC experience anyone?
Date Mon, 04 May 2009 15:43:55 GMT
I'd like to address MIME4J-130 but I'm not sure how to do it..

For MIME4J-130 special characters would have to allowed in the
display-name portion of a "name-addr" or "group"
(http://tools.ietf.org/html/rfc5322#section-3.4). A display-name is a
"phrase" and AddressListParser.jjt defines it as:

  void phrase() :
  {}
  {
  (	<DOTATOM>
  |	<QUOTEDSTRING>
  )+
  }

So this production would have to be relaxed - but only when parsing an
address in its decoded form. The production should stay the same when
parsing an address in its raw transport-encoded form..

The question is, is it possible with JavaCC to say: use production P1
if the parser has been initialized with a certain constructor
parameter, otherwise use production P2. I don't think that a JAVACODE
production (https://javacc.dev.java.net/doc/javaccgrm.html#JAVACODE)
could do the trick because they cannot appear at choice points.

Is it maybe possible to define two parser that share some common productions?

Any ideas?

Markus

Mime
View raw message