The SieveProduction class is the common base class for SieveArgument, SieveCommand and the other classes that describe a single production in the Sieve grammar (or lexer). The "start" symbol is represented by SieveScript.
SieveProduction does very little except remember where in the source it comes from, so errors can be reported well.
Constructs a SieveProduction for a production whose sieve name is name.
Records that the list of extensions are available in this production and its children.
Returns a pointer to a list of extensions added by ihave or require, or a null pointer if none have been added.
Returns what setEnd() set, or 0.
Returns what setError() set, or an empty string if no error has occured.
Returns true if (some) errors must be suppressed because this production or a child of it might use unsupported extensions.
Returns the name of this production as defined in RFC 5228 section 8.
Returns a pointer to this object's parent, or a null pointer if none has been set.
Records that the sieve script requires extension. Should be called whenever a part of the parser sees that the input depends on a given extension. SieveScript::parse() checks that the "require" names this set of extensions.
Notifies this SieveProduction that its parsing ended at position p. The first character in the source is 0, and we count bytes, not lines.
Records that this production suffers from error e. Does nothing if setError has been called already.
Records that an ihave test will fail when executed, so this production (or a child) might contain unknown extensions.
Notifies this SieveProduction that it's a child of parent. The parent() is used to construct error messages.
This slightly hacky function records that the production was parsed by p, and p should also be used to report any errors this object might have. Could have been done as a constructor argument, but I've already written the constructors and I don't want to do all the editing.
The initial value is 0.
Notifies this SieveProduction that its parsing started at position p. The first character in the source is 0, and we count bytes, not lines.
Returns what setStart() set, or 0.
Returns a list of all supported sieve extensions. The list is allocated for the purpose, so the caller can modify it at will.
The extensions are: BODY from RFC 5173. COPY from RFC 3894. DATE from RFC 5260. EREJECT from RFC 5429, IHAVE from RFC 5463. RFC 5228 defines several optional capabilities, we implement all (I think). RELATIONAL is from RFC 5231, SUBADDRESS is from RFC 5233 and VACATION from RFC 5230.
RFC 5260also defines INDEX, which we don't implement, it doesn't seem useful.
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.