DKP Log Parser Forum Index
 Forum FAQ   Search   Register   Log in 
 About   Download   Forum   Wiki   Development
Conjunctions and disjunctions of XML conditions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Suggestions - Completed

Author

Message

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Fri Apr 28, 2006 12:14 pm    Post subject: Conjunctions and disjunctions of XML conditions

Reply with quote


Status: Included in version 1.3.10

Problem
The head conditions used when using DKP Log Parser's XML patterns were built with the assumption that each condition would only depend on a single element and that element's contents. That limits the possibilities, for instance one can not do the following posted in a configuration thread.

Nomad_Wanderer wrote:
I.e. all purple loot, AND any loot that has a note ("Track")?


Suggestion
The suggestion is to add conjunctions and disjunctions (AND and OR operators) on a condition level, so that e.g. only one condition has to be satisfied. Technically conjunctions are already available as per default all conditions have to be satisfied at the same time, but those conjunctions can for instance not be nested.

How the code should be modified
Rebuild the head conditions, split into a central interface (HeadCondition) with an abstract implementation (AbstractHeadCondition) and three subclasses: AtomicHeadCondition, HeadConditionConjunction and HeadConditionDisjunction.

Modify the XML pattern parser to conform to the following BNF (introducing "~" as the new OR operator):
Code:

xmlPattern ::= <body> ":" <head>
body ::= <element> <moreElements>
element ::= <regexp>
moreElements ::= ">" <element> <moreElements>
               | ''empty''
regexp ::= "!" <regexpContents>
         | <regexpContents>
regexpContents ::= <character> <moreCharacters>
character ::= ''[^:<>#"~]''
            | "#".
moreCharacters ::= <character> <moreCharacters>
                 | ''empty''
head ::= <headCondition> <moreHeadConditions>
headCondition ::= """ <headCondition> <moreHeadConditions> """
                | <atomicHeadCondition>
atomicHeadCondition ::= <regexp> "<" <regexp>
moreHeadConditions ::= ">" <headCondition> <moreHeadConditions>
                     | "~" <headCondition> <moreHeadConditions>
                     | "?" <moreHeadConditions>
                     | ''empty''


Modify the XML parser so that it provides the contents of all children of the current node instead of just the contents of a single child.

Back to top

Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Suggestions - Completed All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
SoftGreen 1.1 phpBB theme © DaTutorials.com 2005